[Python-checkins] r84324 - in python/branches/release27-maint: Lib/urllib2.py Misc/NEWS

senthil.kumaran python-checkins at python.org
Thu Aug 26 08:20:13 CEST 2010


Author: senthil.kumaran
Date: Thu Aug 26 08:20:13 2010
New Revision: 84324

Log:
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.
........


Modified:
   python/branches/release27-maint/   (props changed)
   python/branches/release27-maint/Lib/urllib2.py
   python/branches/release27-maint/Misc/NEWS

Modified: python/branches/release27-maint/Lib/urllib2.py
==============================================================================
--- python/branches/release27-maint/Lib/urllib2.py	(original)
+++ python/branches/release27-maint/Lib/urllib2.py	Thu Aug 26 08:20:13 2010
@@ -843,7 +843,10 @@
             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)

Modified: python/branches/release27-maint/Misc/NEWS
==============================================================================
--- python/branches/release27-maint/Misc/NEWS	(original)
+++ python/branches/release27-maint/Misc/NEWS	Thu Aug 26 08:20:13 2010
@@ -33,6 +33,9 @@
 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.
 


More information about the Python-checkins mailing list