From: Martin v. Löwis Date: Thu, 6 May 2004 01:41:26 +0000 (+0000) Subject: Patch #944110: Properly process empty passwords. Fixes #944082. X-Git-Tag: v2.4a1~444 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8b3e871a19f414257b8f4a361d9c2c063a5f8015;p=thirdparty%2FPython%2Fcpython.git Patch #944110: Properly process empty passwords. Fixes #944082. Backported to 2.3. --- diff --git a/Lib/urllib2.py b/Lib/urllib2.py index 39dadbd1bf12..1984cf294bb0 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -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: