summaryrefslogtreecommitdiffstats
path: root/Lib/urllib2.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2004-05-06 01:41:26 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2004-05-06 01:41:26 (GMT)
commit8b3e871a19f414257b8f4a361d9c2c063a5f8015 (patch)
treeda9ecd22cbd881486ca4af666b7dc029cdd8a225 /Lib/urllib2.py
parentf1f056083247ce28973e8f1e589b89f57fa410b6 (diff)
downloadcpython-8b3e871a19f414257b8f4a361d9c2c063a5f8015.zip
cpython-8b3e871a19f414257b8f4a361d9c2c063a5f8015.tar.gz
cpython-8b3e871a19f414257b8f4a361d9c2c063a5f8015.tar.bz2
Patch #944110: Properly process empty passwords. Fixes #944082.
Backported to 2.3.
Diffstat (limited to 'Lib/urllib2.py')
-rw-r--r--Lib/urllib2.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py
index 39dadbd..1984cf2 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: