From: Martin v. Löwis Date: Thu, 6 May 2004 01:40:57 +0000 (+0000) Subject: Patch #944110: Properly process empty passwords. Fixes #944082. X-Git-Tag: v2.3.4c1~39 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d60df17b96837d8efa90566b1aa1130021a91e48;p=thirdparty%2FPython%2Fcpython.git Patch #944110: Properly process empty passwords. Fixes #944082. --- diff --git a/Lib/urllib2.py b/Lib/urllib2.py index 8c164d63a53c..9c3bcd54deae 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -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: diff --git a/Misc/NEWS b/Misc/NEWS index b003799aedb5..00cca3cb3cff 100644 --- 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.