]> granicus.if.org Git - python/commitdiff
Patch #944110: Properly process empty passwords. Fixes #944082.
authorMartin v. Löwis <martin@v.loewis.de>
Thu, 6 May 2004 01:41:26 +0000 (01:41 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Thu, 6 May 2004 01:41:26 +0000 (01:41 +0000)
Backported to 2.3.

Lib/urllib2.py

index 39dadbd1bf125980bbcebed1ea694e43eeb66a98..1984cf294bb0d29f1b6ad4e90939496211ab8503 100644 (file)
@@ -696,7 +696,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: