Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

urllib2 basicauth broken in 2.6.5: RuntimeError: maximum recursion depth exceeded in cmp #53043

Closed
jonozzz mannequin opened this issue May 24, 2010 · 34 comments
Closed
Assignees
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@jonozzz
Copy link
Mannequin

jonozzz mannequin commented May 24, 2010

BPO 8797
Nosy @orsenthil, @vstinner, @bitdancer, @greatestape, @serhiy-storchaka
Files
  • urllib2-8797-fix-workaround.patch: workaround for a side-effect of the fix for this issue
  • basic_auth.patch
  • simpler_fix.patch: Patch for 2.7.x: Removes complex retries fix and applies simple get_header fix
  • issue8797_with_tests.diff
  • 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 = 'https://github.com/orsenthil'
    closed_at = <Date 2014-08-20.10:14:39.703>
    created_at = <Date 2010-05-24.01:42:10.968>
    labels = ['type-bug', 'library']
    title = 'urllib2 basicauth broken in 2.6.5: RuntimeError: maximum recursion depth exceeded in cmp'
    updated_at = <Date 2016-07-29.14:27:07.418>
    user = 'https://bugs.python.org/jonozzz'

    bugs.python.org fields:

    activity = <Date 2016-07-29.14:27:07.418>
    actor = 'r.david.murray'
    assignee = 'orsenthil'
    closed = True
    closed_date = <Date 2014-08-20.10:14:39.703>
    closer = 'orsenthil'
    components = ['Library (Lib)']
    creation = <Date 2010-05-24.01:42:10.968>
    creator = 'jonozzz'
    dependencies = []
    files = ['18121', '18648', '20471', '36377']
    hgrepos = []
    issue_num = 8797
    keywords = ['patch']
    message_count = 34.0
    messages = ['106342', '106345', '106346', '106759', '106834', '106877', '106878', '107015', '107033', '107043', '107261', '111159', '111161', '111172', '114922', '114956', '114962', '114963', '115051', '115060', '115070', '126657', '128246', '225348', '225388', '225394', '225403', '225404', '225405', '225406', '225549', '225563', '271620', '271629']
    nosy_count = 14.0
    nosy_names = ['orsenthil', 'vstinner', 'kiilerix', 'jonozzz', 'r.david.murray', 'Dmitry.Jemerov', 'chuchiperriman', 'Jurjen', 'zenyatta', 'greatape', 'olemartinorg', 'python-dev', 'serhiy.storchaka', 'Kim Randell']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue8797'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

    @jonozzz
    Copy link
    Mannequin Author

    jonozzz mannequin commented May 24, 2010

    The URL I'm trying to open is using basicauth and the username/password is incorrect.

    This works flawlessly in 2.6.4.

    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 397, in open
    response = meth(req, response)
    File "/home/jono/work/sites/test123/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
    File "/home/jono/work/sites/test123/urllib2.py", line 429, in error
    result = self._call_chain(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 855, in http_error_401
    url, req, headers)
    File "/home/jono/work/sites/test123/urllib2.py", line 833, in http_error_auth_reqed
    return self.retry_http_basic_auth(host, req, realm)
    File "/home/jono/work/sites/test123/urllib2.py", line 843, in retry_http_basic_auth
    return self.parent.open(req, timeout=req.timeout)
    File "/home/jono/work/sites/test123/urllib2.py", line 391, in open
    response = self._open(req, data)
    File "/home/jono/work/sites/test123/urllib2.py", line 409, in _open
    '_open', req)
    File "/home/jono/work/sites/test123/urllib2.py", line 369, in _call_chain
    result = func(*args)
    File "/home/jono/work/sites/test123/urllib2.py", line 1169, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
    File "/home/jono/work/sites/test123/urllib2.py", line 1107, in do_open
    h = http_class(host, timeout=req.timeout) # will parse host:port
    File "/usr/lib64/python2.6/httplib.py", line 1104, in __init__
    HTTPConnection.__init__(self, host, port, strict, timeout)
    File "/usr/lib64/python2.6/httplib.py", line 660, in __init__
    self._set_hostport(host, port)
    File "/usr/lib64/python2.6/httplib.py", line 689, in _set_hostport
    if host and host[0] == '[' and host[-1] == ']':
    RuntimeError: maximum recursion depth exceeded in cmp

    @jonozzz jonozzz mannequin added type-crash A hard crash of the interpreter, possibly with a core dump stdlib Python modules in the Lib dir labels May 24, 2010
    @orsenthil
    Copy link
    Member

    Is the behavior you posted observable on trunk?

    @orsenthil orsenthil self-assigned this May 24, 2010
    @orsenthil
    Copy link
    Member

    Okay, I see you have mentioned 2.6.5 in the Title.
    I will try the following to reproduce this.

    1. Try a Basis Auth which is working.
    2. Pass an Invalid username/password and see the behavior.

    @chuchiperriman
    Copy link
    Mannequin

    chuchiperriman mannequin commented May 30, 2010

    The same problem for me, it tries to authenticate infinite times if the user/password are incorrect

    @orsenthil
    Copy link
    Member

    This is fixed in r81636, r81637, r81638, r81637.
    Just like the Digest Authentication, the urllib2 will try for 5 times before failing for any authentication failure ( It won't lead to recursion).

    I had a thought that Basic Authentication need not be retried (no where in the RFC it mentions about it), but I found some references that clients do present the dialog a couple of times for retry on wrong authentication, so we are going for the same.

    This is tested with actual resource setup. Closing this issue as this bug is fixed.

    @jonozzz
    Copy link
    Mannequin Author

    jonozzz mannequin commented Jun 2, 2010

    Why would you waste the time and resources to test 5 times for a known to be wrong credential ?!

    This is not like in a browser where the user is presented with a dialog box 5 times and he/she can try different credentials.

    I don't see the point...

    @orsenthil
    Copy link
    Member

    The point of retry is for auth failure, which can happen due to any reason. It is not just for a wrong password.

    I was thinking just doing a single verification and failing, but did find some resources (not just browsers) which adopt this approach of retry.

    BTW, Basic auth is gone now and Digest auth has some recommendations so I found its fine to do the same way as Digest auth does.

    @Jurjen
    Copy link
    Mannequin

    Jurjen mannequin commented Jun 4, 2010

    I would like to point out that this is not going to work if someone visits more than 5 sites with the same authentication manager. This would have to be documentated, at least.
    We could fix this by putting the retry counter in the HTTPPasswordMgr; it is not hard to put in an extra field in the password database with the retry counter. See also my remarks in bpo-8894

    @bitdancer
    Copy link
    Member

    +1 for putting retry control on the password manager. Probably the default should be set to 1. If I understand correctly, it is the password manager that would be prompting the user for a new password, if someone chose to implement such a password manager.

    @orsenthil
    Copy link
    Member

    Agree to single retry for Basic Auth. We are just dealing with BasicAuthentication here, so that's why we did not have in the HTTPPasswdManager. But, let me consider that viewpoint too.

    @orsenthil orsenthil reopened this Jun 4, 2010
    @kiilerix
    Copy link
    Mannequin

    kiilerix mannequin commented Jun 7, 2010

    FYI:
    The regression was introduced in 2.6.5 with bpo-3819 .

    This also causes problems with Mercurial pushing to google code - see http://mercurial.selenic.com/bts/issue2179 .

    IIRC google code redirects to an url which then in turn requests authentication. I'm not sure how that will work with a retry count of 1. The funny and inconsistent thing is that it apparently would work if they replied 403 instead of 401. "durin42" from google/mercurial knows the details.

    (It seems suspicious to me that there are code paths where the retry counter is reset. Doesn't that mean that a remote server will be able to cause endless recursion? Shouldn't there be some kind of hard upper limit on the number of retries?)

    @zenyatta
    Copy link
    Mannequin

    zenyatta mannequin commented Jul 22, 2010

    I work in sidux and my Mercurial currently doesn't work. The python version already contains the fix for this issue (revision 81637) and it crashes Mercurial ("authorization failed") whenever a command involves more than 5 requests to the repository. I fixed it by resetting the retry counter upon successful authorization (see patch). Maybe this helps someone in a similar situation. The patch was made against trunk using "diff -u".

    @kiilerix
    Copy link
    Mannequin

    kiilerix mannequin commented Jul 22, 2010

    zenyatta: Which Mercurial version? We thought we had implemented a sufficiently ugly workaround in Mercurial. Please file an issue in http://mercurial.selenic.com/bts/ .

    @zenyatta
    Copy link
    Mannequin

    zenyatta mannequin commented Jul 22, 2010

    @DmitryJemerov
    Copy link
    Mannequin

    DmitryJemerov mannequin commented Aug 25, 2010

    I've also run into this problem after upgrading to Python 2.6.6. My code, which uses the same HTTPBasicAuthHandler instance for many requests to the same server, worked correctly with Python 2.6.2 and broke with 2.6.6. It would be great if zenyatta's patch to fix the regression was included in 2.6.7.
    Also, unfortunately NEWS.txt doesn't mention this change at all.

    @orsenthil
    Copy link
    Member

    I checked in a modified version of reset the retry count for respnse code !=401 in the following checkins:
    r84323 (py3k)
    r84324 (release21-maint)
    r84325 (release31-maint)

    Unfortunately, we wont be able to patch the 2.6.x release. You might want to use patch which is attached or fix it at mercurial end.

    Another issue, bpo-9639 was fixed to reset the retry on successful response.

    I am going to close this issue, there was a minor discussion in the middle if 5 retries in worth it, but it looks like it is (msg107261).

    @orsenthil
    Copy link
    Member

    r84324 (release21-maint)

    That should be release27-maint. :)

    @kiilerix
    Copy link
    Mannequin

    kiilerix mannequin commented Aug 26, 2010

    Senthil, can you tell us why this fix is correct - and convince us that it is the Final Fix for this issue? Not because I don't trust you, but because this issue has a bad track record.

    Some comments/questions to this patch:

    Why do 401 require such special handling? Why not handle it like the other errors?

    How do this work together with http://code.google.com/p/support/issues/detail?id=3985 ?

    Detail: I'm surprised you don't use reset_retry_count() - that makes it a bit harder to grok the code. And the patch doesn't reduce the complexity of the code.

    But ... I really don't understand ... .retried is a kind of error counter. Why do we reset it on errors? I would expect it to be reset on success ... or perhaps on anything but 401, 403 and 407. Or perhaps it should be reset whenever a new URL is requested.

    @orsenthil
    Copy link
    Member

    On Thu, Aug 26, 2010 at 3:24 PM, Mads Kiilerich <report@bugs.python.org> wrote:

    Mads Kiilerich <mads@kiilerich.com> added the comment:

    Senthil, can you tell us why this fix is correct - and convince us that it is the Final Fix for this issue?

    Hello Mads, this may not be be final fix. I just adopted what was
    already done for Digest Auth for the Basic Auth, it could be an
    interim solution that avoids recursion problem.

    I agree with you respect to the other error codes, there is already
    another bug open to handle this. The reset counter is reset on success
    too, in another part of the code. I shall respond to the other
    questions a bit later (1 week, I am kind of busy at the moment) and
    lets go for the best fix as discussed.

    Thanks,
    Senthil

    @kiilerix
    Copy link
    Mannequin

    kiilerix mannequin commented Aug 27, 2010

    On 08/27/2010 03:47 AM, Senthil Kumaran wrote:

    I agree with you respect to the other error codes, there is already
    another bug open to handle this. The reset counter is reset on success
    too, in another part of the code.

    FWIW: From Mercurial it is our experience that the reset counter only
    gets reset on errors, never on success.

    @bitdancer
    Copy link
    Member

    See also new bpo-9698.

    @greatestape
    Copy link
    Mannequin

    greatestape mannequin commented Jan 20, 2011

    I think there's a much simpler solution to this ticket than the retry logic that's currently in place.

    The code originally avoided the infinite recursion by checking to see if the previous request had already submitted the auth credentials that would be used in the retry. If it had, it would return None. If it hadn't, it would add the auth credentials to the request header and the request again:

                if req.headers.get(self.auth_header, None) == auth:
                    return None
                req.add_header(self.auth_header, auth)

    Then, to fix bpo-3819, it was changed. Instead of calling add_header, it called add_unredirected_header:

                if req.headers.get(self.auth_header, None) == auth:
                    return None
                req.add_unredirected_header(self.auth_header, auth)

    This caused the loop because the auth creds were going into unredirected_hdrs instead of the headers dict.

    But I think the original logic is sound. The code just wasn't checking in all the headers. Luckily there's a get_header method that checks both for you. This one-line change should fix the issue:

                if req.get_header(self.auth_header, None) == auth:
                    return None
                req.add_unredirected_header(self.auth_header, auth)

    I think this fix is cleaner and makes more sense, but I'm worried I might be missing something. I don't fully understand the distinction between headers and unredirected headers. Maybe there's a reason why the code isn't checking in unredirected headers for the auth header.

    I'm attaching a patch. I'm new to contributing to python so I apologize if the format is wrong.

    @pitrou pitrou reopened this Feb 2, 2011
    @pitrou pitrou removed the type-crash A hard crash of the interpreter, possibly with a core dump label Feb 2, 2011
    @pitrou pitrou added the type-bug An unexpected behavior, bug, or error label Feb 2, 2011
    @olemartinorg
    Copy link
    Mannequin

    olemartinorg mannequin commented Feb 9, 2011

    Thanks Sam! I can confirm that your patch is working well with basic auth. I have not tried other authentication methods, though. I'm not sure about the unredirected headers, but your fix looks like the cleanest.

    @orsenthil
    Copy link
    Member

    This bug has been open for a while and I had lost sight of it. Upon prompted recently, I dug bit
    into history and could think of a good solution.

    A brief history.

    1. The bug "maximum recursion depth exceeded" when doing Basic Authentication was introduced in
      5f9939af2f71 (bpo-3819). I verified it by doing "hg update 5f9939af2f71" and running basic
      authentication test against a server.

    2. This was 'fixed' with giving an upper limit to retries and doing it similar to Digest
      Authentication as part of this ticket and it is case recent current tip
      (acb30ed7eceb when I ran the test).

    However, this fix is not satisfactory for multiple reasons like fix is not satisfactory and not
    having concrete reasons for doing retries for Basic Auth and why 401 error should be considered
    special. I agree with this, this fix was more like to avoid recursion
    and throw the correct HTTPError.

    Also, it is important to note that, before a regression was introduced in r59118, the prior
    revision ( hg update 5f9939af2f71^ -which led me to c8ef906b11b8) had correct behavior, where
    HTTPError was thrown upon invalid user:pass immediately.

    So, going back to that behavior was the right thing to do.

    Sam Bull's suggestion and patch looks right to me. It is correct to verify the un-redirected hdrs
    too when checking for auth and go with the behavior as it in c8ef906b11b8)

    I have improved upon the patch for 3.5 and added tests which were not present too. I think, this
    should go in all active versions of python as there is no api change or behavior behavior, but
    improvement in way HTTPError is thrown.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Aug 16, 2014

    New changeset e0510a3bdf8f by Senthil Kumaran in branch '2.7':
    Fix Issue bpo-8797: Raise HTTPError on failed Basic Authentication immediately. Initial patch by Sam Bull.
    http://hg.python.org/cpython/rev/e0510a3bdf8f

    New changeset 3435c5865cfc by Senthil Kumaran in branch '3.4':
    Fix Issue bpo-8797: Raise HTTPError on failed Basic Authentication immediately. Initial patch by Sam Bull.
    http://hg.python.org/cpython/rev/3435c5865cfc

    New changeset 7cb90d70ce19 by Senthil Kumaran in branch 'default':
    merge from 3.4
    http://hg.python.org/cpython/rev/7cb90d70ce19

    @vstinner
    Copy link
    Member

    test_urllib2_localnet now fails since the changeset 3435c5865cfc. Example:
    http://buildbot.python.org/all/builders/x86%20RHEL%206%203.x/builds/4410/steps/test/logs/stdio
    http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/builds/10518/steps/test/logs/stdio

    test_basic_auth_success (test.test_urllib2_localnet.BasicAuthTests) ... ----------------------------------------

    Exception happened during processing of request from ('127.0.0.1', 51031)
    Traceback (most recent call last):
      File "/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/socketserver.py", line 321, in _handle_request_noblock
        self.process_request(request, client_address)
      File "/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/socketserver.py", line 347, in process_request
        self.finish_request(request, client_address)
      File "/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/socketserver.py", line 360, in finish_request
        self.RequestHandlerClass(request, client_address, self)
      File "/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/test/test_urllib2_localnet.py", line 289, in http_server_with_basic_auth_handler
        return BasicAuthHandler(*args, **kwargs)
      File "/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/test/test_urllib2_localnet.py", line 212, in __init__
        http.server.SimpleHTTPRequestHandler.__init__(self, *args, **kwargs)
      File "/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/socketserver.py", line 685, in __init__
        self.handle()
      File "/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/http/server.py", line 398, in handle
        self.handle_one_request()
      File "/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/http/server.py", line 386, in handle_one_request
        method()
      File "/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/test/test_urllib2_localnet.py", line 235, in do_GET
        http.server.SimpleHTTPRequestHandler.do_GET(self)
      File "/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/http/server.py", line 677, in do_GET
        f = self.send_head()
      File "/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/http/server.py", line 716, in send_head
        return self.list_directory(path)
      File "/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/http/server.py", line 772, in list_directory
        % (urllib.parse.quote(linkname), html.escape(displayname)))
      File "/home/buildbot/buildarea/3.x.coghlan-redhat/build/Lib/urllib/parse.py", line 688, in quote
        string = string.encode(encoding, errors)
    UnicodeEncodeError: 'utf-8' codec can't encode character '\udcff' in position 16: surrogates not allowed

    ERROR

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Aug 16, 2014

    New changeset 5336a01542e2 by Senthil Kumaran in branch '2.7':
    backout changeset e0510a3bdf8f - due to buildbot failures. Ref: Issue bpo-8797
    http://hg.python.org/cpython/rev/5336a01542e2

    New changeset d51e739004bc by Senthil Kumaran in branch '3.4':
    backout changeset 3435c5865cfc due to buildbot failures. Ref bpo-8797
    http://hg.python.org/cpython/rev/d51e739004bc

    New changeset 3d45155b7b9b by Senthil Kumaran in branch 'default':
    merge 3.4; backout changeset 3435c5865cfc due to buildbot failures. Ref bpo-8797
    http://hg.python.org/cpython/rev/3d45155b7b9b

    @orsenthil
    Copy link
    Member

    I have backed out my changes. The buildbot failures were new as I could not reproduce them in my local test on Mac. I will run the buildbot suite on branch and fix it before committing.

    @serhiy-storchaka
    Copy link
    Member

    May be bpo-22165 patch fixes this test failure.

    @orsenthil
    Copy link
    Member

    @serhiy, yeah, I think the patch attached to bpo-22165 will fix one of the buildbot failures. For this issue. there was another one with Broken PIPE which may need a different fix.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Aug 20, 2014

    New changeset c1edc4e43eb1 by Senthil Kumaran in branch '2.7':
    Fix Issue bpo-8797: Raise HTTPError on failed Basic Authentication immediately. Initial patch by Sam Bull.
    http://hg.python.org/cpython/rev/c1edc4e43eb1

    New changeset 30e8a8f22a2a by Senthil Kumaran in branch '3.4':
    Fix Issue bpo-8797: Raise HTTPError on failed Basic Authentication immediately. Initial patch by Sam Bull.
    http://hg.python.org/cpython/rev/30e8a8f22a2a

    New changeset 10d0a692b1b6 by Senthil Kumaran in branch 'default':
    merge from 3.4
    http://hg.python.org/cpython/rev/10d0a692b1b6

    @orsenthil
    Copy link
    Member

    This is fixed in all active versions (2.7.8+, 3.4.2? and 3.5). Thanks all!

    @KimRandell
    Copy link
    Mannequin

    KimRandell mannequin commented Jul 29, 2016

    I don't have an example case, but from reading the code it looks as though the AbstractDigestAuthHandler has exactly the same faults as the old version of AbstractBasicAuthHandler (i.e. using req.headers.get instead of req.get_header, and corresponding retry workarounds). Should it be updated to match?

    @bitdancer
    Copy link
    Member

    Kim: if you can prove it is broken, please open a new issue, this one is closed (you can reference it by just typing # followed by the issue number, and the tracker will automatically make a link).

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    5 participants