]> granicus.if.org Git - python/commitdiff
Sending the auth info as string. Fix BytesWarning: str() on a bytes instance Exceptio...
authorSenthil Kumaran <orsenthil@gmail.com>
Wed, 4 Aug 2010 17:46:23 +0000 (17:46 +0000)
committerSenthil Kumaran <orsenthil@gmail.com>
Wed, 4 Aug 2010 17:46:23 +0000 (17:46 +0000)
Lib/urllib/request.py

index 24a4797c884d05e431e11411649126e3cdb6b8e8..012814c948b32363fb13d80f59efd96bdb3fe0bc 100644 (file)
@@ -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)