Commit 561d6a5d authored by Senthil Kumaran's avatar Senthil Kumaran

Fix Issue8797 - Reset the basic auth retry count when response code is not 401.

parent f17ef6a9
...@@ -799,7 +799,10 @@ class AbstractBasicAuthHandler: ...@@ -799,7 +799,10 @@ class AbstractBasicAuthHandler:
if mo: if mo:
scheme, quote, realm = mo.groups() scheme, quote, realm = mo.groups()
if scheme.lower() == 'basic': 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): def retry_http_basic_auth(self, host, req, realm):
user, pw = self.passwd.find_user_password(realm, host) user, pw = self.passwd.find_user_password(realm, host)
......
...@@ -132,6 +132,9 @@ Extensions ...@@ -132,6 +132,9 @@ Extensions
Library Library
------- -------
- Issue #8797: urllib2 does a retry for Basic Authentication failure instead of
falling into recursion.
- Issue #1194222: email.utils.parsedate now returns RFC2822 compliant four - Issue #1194222: email.utils.parsedate now returns RFC2822 compliant four
character years even if the message contains RFC822 two character years. character years even if the message contains RFC822 two character years.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment