diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2010-08-26 06:20:13 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2010-08-26 06:20:13 (GMT) |
commit | 7e8fd5ed22f19ede1290fdc692c607556d4e16da (patch) | |
tree | d5b646b8a0ab9cd54d7eddeef8d021f22493e8cc /Lib/urllib2.py | |
parent | 6f3d6a9b2369dd68970bd47e85b27ee624580aaa (diff) | |
download | cpython-7e8fd5ed22f19ede1290fdc692c607556d4e16da.zip cpython-7e8fd5ed22f19ede1290fdc692c607556d4e16da.tar.gz cpython-7e8fd5ed22f19ede1290fdc692c607556d4e16da.tar.bz2 |
Merged revisions 84323 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r84323 | senthil.kumaran | 2010-08-26 11:46:22 +0530 (Thu, 26 Aug 2010) | 3 lines
Fix Issue8797 - Reset the basic auth retry count when response code is not 401.
........
Diffstat (limited to 'Lib/urllib2.py')
-rw-r--r-- | Lib/urllib2.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py index 0821761..5c717a4 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -843,7 +843,10 @@ class AbstractBasicAuthHandler: if mo: scheme, quote, realm = mo.groups() if scheme.lower() == 'basic': - return self.retry_http_basic_auth(host, req, realm) + response = self.retry_http_basic_auth(host, req, realm) + if response and response.code != 401: + self.retried = 0 + return response def retry_http_basic_auth(self, host, req, realm): user, pw = self.passwd.find_user_password(realm, host) |