summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/urllib2.py5
-rw-r--r--Misc/NEWS3
2 files changed, 7 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)
diff --git a/Misc/NEWS b/Misc/NEWS
index fcd4ae0..deceec4 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -33,6 +33,9 @@ Core and Builtins
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
character years even if the message contains RFC822 two character years.