From d60df17b96837d8efa90566b1aa1130021a91e48 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Thu, 6 May 2004 01:40:57 +0000 Subject: [PATCH] Patch #944110: Properly process empty passwords. Fixes #944082. --- Lib/urllib2.py | 2 +- Misc/NEWS | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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. -- 2.47.3