Skip to content

Bug in cookiejar #53221

Closed
Closed

Description

@PCManticore
BPO 8975
Nosy @merwok, @PCManticore
Superseder
  • bpo-3924: cookielib chokes on non-integer cookie version, should ignore it instead
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2010-07-12.20:31:34.819>
    created_at = <Date 2010-06-11.17:34:48.154>
    labels = ['type-bug', 'library']
    title = 'Bug in cookiejar'
    updated_at = <Date 2010-07-12.20:31:34.818>
    user = 'https://github.com/PCManticore'

    bugs.python.org fields:

    activity = <Date 2010-07-12.20:31:34.818>
    actor = 'eric.araujo'
    assignee = 'none'
    closed = True
    closed_date = <Date 2010-07-12.20:31:34.819>
    closer = 'eric.araujo'
    components = ['Library (Lib)']
    creation = <Date 2010-06-11.17:34:48.154>
    creator = 'Claudiu.Popa'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 8975
    keywords = []
    message_count = 5.0
    messages = ['107564', '107565', '107566', '107568', '110118']
    nosy_count = 3.0
    nosy_names = ['jjlee', 'eric.araujo', 'Claudiu.Popa']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '3924'
    type = 'behavior'
    url = 'https://bugs.python.org/issue8975'
    versions = ['Python 3.1']

    Activity

    1. PCManticore commented on Jun 11, 2010

      PCManticoremannequin
      MannequinAuthor

      Hello. This is my first report, sorry if I won't do it right.
      I found a bug in cookielib, which looks like this(a traceback):

      """C:\Python31\lib\http\cookiejar.py:1586: UserWarning: http.cookiejar bug!
      Traceback (most recent call last):
        File "C:\Python31\lib\http\cookiejar.py", line 1584, in make_cookies
          parse_ns_headers(ns_hdrs), request)
        File "C:\Python31\lib\http\cookiejar.py", line 1541, in _cookies_from_attrs_se
      t
          cookie = self._cookie_from_cookie_tuple(tup, request)
        File "C:\Python31\lib\http\cookiejar.py", line 1460, in _cookie_from_cookie_tu
      ple
          version = int(version)
      ValueError: invalid literal for int() with base 10: '1.0'

      _warn_unhandled_exception()"""

    2. added
      type-crash
      stdlib
      on Jun 11, 2010
    3. merwok commented on Jun 11, 2010

      @merwok
      Member

      Thanks for your report. Can you copy the code provoking the bug?

    4. PCManticore commented on Jun 11, 2010

      PCManticoremannequin
      MannequinAuthor

      """ CHttp.__init__(self,1,proxy = shared.setts.currentGoogleProxy)
      self.timeout = shared.setts.cGglHttpTimeout

                      self.proxy = globShare.currentGoogleProxy[globShare.currentGoogleIndex]
                      if self.proxy:
                              proxy_support = urllib.request.ProxyHandler({'http':self.proxy,'https':self.proxy,'ftp':self.proxy})
                      else:
                              proxy_support = urllib.request.ProxyHandler({})
                      #socket.setdefaulttimeout(30)
                          #self._cp = urllib.request.HTTPCookieProcessor(http.cookiejar.CookieJar())
      
                      self._cj = http.cookiejar.MozillaCookieJar()
                      self._opener1 = urllib.request.build_opener(proxy_support,self._cp)
      ..... openedUrl = self._opener1.open(req)"""

      The script was a crawler that searches for pdf's on internet. One thread printed the untreated exception.

    5. merwok commented on Jun 11, 2010

      @merwok
      Member

      Could you provide a minimal usable script? We can’t run your excerpt to
      reproduce the bug, and reproducing is the first step to debugging. I
      think we’ll also need the site address, or the cookie header, or the
      cookies file that provoke the bug.

    6. jjlee commented on Jul 12, 2010

      jjleemannequin
      Mannequin

      This is a duplicate of bpo-3924

    7. added
      type-bug
      and removed
      type-crash
      on Jul 12, 2010
    8. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      stdlibtype-bug

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions