diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2010-08-26 06:24:04 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2010-08-26 06:24:04 (GMT) |
commit | 06509381a88aa3abb71f70674108fdeb42238606 (patch) | |
tree | dfa6200c47cf0e513d574e9ff379e32123db5cdb /Lib/urllib/request.py | |
parent | 039d0a00c82fa451bc837bc4561e855d36934074 (diff) | |
download | cpython-06509381a88aa3abb71f70674108fdeb42238606.zip cpython-06509381a88aa3abb71f70674108fdeb42238606.tar.gz cpython-06509381a88aa3abb71f70674108fdeb42238606.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/urllib/request.py')
-rw-r--r-- | Lib/urllib/request.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 4beafc1..c638cfa5 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -799,7 +799,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) |