summaryrefslogtreecommitdiffstats
path: root/Lib/urllib
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-08-01 17:53:37 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2010-08-01 17:53:37 (GMT)
commitde0eb249c61b6c0164b635f5afb0cbefec48cb04 (patch)
tree3de2d739e7bd6594326403cc0ac476e4a89126c5 /Lib/urllib
parentc881f1592f9a2890e1c26ae899351e1cf8b5d622 (diff)
downloadcpython-de0eb249c61b6c0164b635f5afb0cbefec48cb04.zip
cpython-de0eb249c61b6c0164b635f5afb0cbefec48cb04.tar.gz
cpython-de0eb249c61b6c0164b635f5afb0cbefec48cb04.tar.bz2
Fix Issue8123 - TypeError in urllib when trying to use HTTP authentication
Diffstat (limited to 'Lib/urllib')
-rw-r--r--Lib/urllib/request.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index 6c4b5f7..24a4797 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -1591,13 +1591,13 @@ class URLopener:
if proxy_passwd:
import base64
- proxy_auth = base64.b64encode(proxy_passwd).strip()
+ proxy_auth = base64.b64encode(proxy_passwd.encode()).strip()
else:
proxy_auth = None
if user_passwd:
import base64
- auth = base64.b64encode(user_passwd).strip()
+ auth = base64.b64encode(user_passwd.encode()).strip()
else:
auth = None
http_conn = connection_factory(host)