summaryrefslogtreecommitdiffstats
path: root/Lib/urllib
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-08-26 06:16:22 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2010-08-26 06:16:22 (GMT)
commit4bb5c273c6897682d99badb872d532806d1e7210 (patch)
tree69a0864372c990020a15fa824824a19193b17f85 /Lib/urllib
parent0e10206f2cc7b3fac5ad30cd45583c8f1a8a6126 (diff)
downloadcpython-4bb5c273c6897682d99badb872d532806d1e7210.zip
cpython-4bb5c273c6897682d99badb872d532806d1e7210.tar.gz
cpython-4bb5c273c6897682d99badb872d532806d1e7210.tar.bz2
Fix Issue8797 - Reset the basic auth retry count when response code is not 401.
Diffstat (limited to 'Lib/urllib')
-rw-r--r--Lib/urllib/request.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index 68a8cab..16d8125 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)