From: Senthil Kumaran Date: Wed, 4 Aug 2010 17:46:23 +0000 (+0000) Subject: Sending the auth info as string. Fix BytesWarning: str() on a bytes instance Exceptio... X-Git-Tag: v3.2a2~467 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5626eec0c2f62999967eff0ab6aa8ad329e8571b;p=thirdparty%2FPython%2Fcpython.git Sending the auth info as string. Fix BytesWarning: str() on a bytes instance Exception on buildbot. --- diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 24a4797c884d..012814c948b3 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.encode()).strip() + proxy_auth = base64.b64encode(proxy_passwd.encode()).decode('ascii') else: proxy_auth = None if user_passwd: import base64 - auth = base64.b64encode(user_passwd.encode()).strip() + auth = base64.b64encode(user_passwd.encode()).decode('ascii') else: auth = None http_conn = connection_factory(host)