RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 669847 - urllib2's AbstractBasicAuthHandler is limited to 6 requests
Summary: urllib2's AbstractBasicAuthHandler is limited to 6 requests
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: python
Version: 6.1
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: rc
: ---
Assignee: Dave Malcolm
QA Contact: Petr Šplíchal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-01-15 00:30 UTC by Dave Malcolm
Modified: 2016-06-01 01:47 UTC (History)
3 users (show)

Fixed In Version: python-2.6.6-8.el6
Doc Type: Bug Fix
Doc Text:
Basic HTTP authentication via the urllib2 module was limited to six requests because the "retried" attribute was not reset when authentication was successful. This attribute is now reset, and authentication requests work as expected.
Clone Of:
Environment:
Last Closed: 2011-05-19 11:37:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:0554 0 normal SHIPPED_LIVE Moderate: python security, bug fix, and enhancement update 2011-05-19 11:35:29 UTC

Description Dave Malcolm 2011-01-15 00:30:25 UTC
Description of problem:
See e.g. http://permalink.gmane.org/gmane.comp.python.enthought.devel/27376

This appears to be a regression in python 2.6.6 relative to 2.6.5

Upstream bug report:
  http://bugs.python.org/issue9639

It is fixed in the upstream 2.7 branch, but was not backported to 2.6 as it's not a security fix:
  http://svn.python.org/view?view=rev&revision=84207


Version-Release number of selected component (if applicable):
  python-2.6.6-3.el6.x86_64

How reproducible:
  100%


Steps to Reproduce:
  Run the following python code fragment, from the enthought mailing list (which relies on browserspy.dk):

---- BEGIN QUOTE ----
import urllib2

passman = urllib2.HTTPPasswordMgrWithDefaultRealm()
passman.add_password(None, 'http://browserspy.dk', 'test', 'test')
authhandler = urllib2.HTTPBasicAuthHandler(passman)
opener = urllib2.build_opener(authhandler)

for i in xrange(10):
    print "Loop {0}".format(i)
    pagehandle = opener.open('http://browserspy.dk/password-ok.php')
    pagehandle.close()
---- END QUOTE -----


Actual results:
  With 2.6.6, it fails on i == 6 with this output:

---- BEGIN QUOTE ----
Loop 0
Loop 1
Loop 2
Loop 3
Loop 4
Loop 5
Loop 6
Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
  File "/usr/lib64/python2.6/urllib2.py", line 397, in open
    response = meth(req, response)
  File "/usr/lib64/python2.6/urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib64/python2.6/urllib2.py", line 429, in error
    result = self._call_chain(*args)
  File "/usr/lib64/python2.6/urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "/usr/lib64/python2.6/urllib2.py", line 864, in http_error_401
    url, req, headers)
  File "/usr/lib64/python2.6/urllib2.py", line 833, in http_error_auth_reqed
    headers, None)
urllib2.HTTPError: HTTP Error 401: basic auth failed
---- END QUOTE -----


Expected results:
With python-2.6.5-9.fc14.x86_64, it successfully runs 10 iterations:
---- BEGIN QUOTE ----
Loop 0
Loop 1
Loop 2
Loop 3
Loop 4
Loop 5
Loop 6
Loop 7
Loop 8
Loop 9
---- END QUOTE -----


(See also bug 649274)

Comment 8 Laura Bailey 2011-05-10 03:11:55 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Basic HTTP authentication via the urllib2 module was limited to six requests because the "retried" attribute was not reset when authentication was successful. This attribute is now reset, and authentication requests work as expected.

Comment 9 errata-xmlrpc 2011-05-19 11:37:11 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0554.html

Comment 10 errata-xmlrpc 2011-05-19 13:07:47 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0554.html


Note You need to log in before you can comment on or make changes to this bug.