From de0eb249c61b6c0164b635f5afb0cbefec48cb04 Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Sun, 1 Aug 2010 17:53:37 +0000 Subject: Fix Issue8123 - TypeError in urllib when trying to use HTTP authentication --- Lib/urllib/request.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/urllib/request.py') diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 6c4b5f7cae..24a4797c88 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) -- cgit v1.2.1