]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #944110: Properly process empty passwords. Fixes #944082.
authorMartin v. Löwis <martin@v.loewis.de>
Thu, 6 May 2004 01:40:57 +0000 (01:40 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Thu, 6 May 2004 01:40:57 +0000 (01:40 +0000)
Lib/urllib2.py
Misc/NEWS

index 8c164d63a53c025bec7761a963acce6f7518d3ff..9c3bcd54deaec5d0aa1e301c83bac8d0d360a9fc 100644 (file)
@@ -639,7 +639,7 @@ class AbstractBasicAuthHandler:
 
     def retry_http_basic_auth(self, host, req, realm):
         user,pw = self.passwd.find_user_password(realm, host)
-        if pw:
+        if pw is not None:
             raw = "%s:%s" % (user, pw)
             auth = 'Basic %s' % base64.encodestring(raw).strip()
             if req.headers.get(self.auth_header, None) == auth:
index b003799aedb5193f274d7dda09f6ae46f90f415f..00cca3cb3cff6aebb309c87d3b69783d6bcba87a 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -42,6 +42,8 @@ Core and builtins
 Library
 -------
 
+- Bug #944082: Empty passwords in urllib2 are now supported.
+
 - Bug #926075: Fixed a bug that returns a wrong pattern object
   for a string or unicode object in sre.compile() when a different
   type pattern with the same value exists.