This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: typos in urllib2 ( cvs )
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: moshez Nosy List: ejfc, moshez, winnegan
Priority: normal Keywords:

Created on 2001-03-07 13:23 by winnegan, last changed 2022-04-10 16:03 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
urllib2.diff winnegan, 2001-03-07 13:23 Fixing typos in urllib2.py
Messages (3)
msg3765 - (view) Author: Siggy (winnegan) Date: 2001-03-07 13:23
urllib2.ProxyHandler fails due to typos when using proxy 
autthentication, patch included.
msg3766 - (view) Author: Eduardo Fernandez Corrales (ejfc) Date: 2001-03-08 17:59
Logged In: YES 
user_id=169128

I have corrected the patch to reflect proper Basic 
Authentication:

--- /var/local/cvs/python/dist/src/Lib/urllib2.py	Thu 
Mar  1 09:46:07 2001
+++ /usr/local/lib/python2.1/urllib2.py	Thu Mar  8 17:23:31 
2001
@@ -477,8 +477,8 @@
         host, XXX = splithost(r_type)
         if '@' in host:
             user_pass, host = host.split('@', 1)
-            user_pass = base64.encode_string(unquote
(user_passw)).strip()
-            req.addheader('Proxy-Authorization', user_pass)
+            user_pass = "Basic " + base64.encodestring
(unquote(user_pass)).strip()
+            req.add_header('Proxy-Authorization', 
user_pass)
         host = unquote(host)
         req.set_proxy(host, type)
         if orig_type == type:
msg3767 - (view) Author: Moshe Zadka (moshez) (Python triager) Date: 2001-03-18 09:14
Logged In: YES 
user_id=11645

Fixed. (Did not use the patch -- fixed it myself)
History
Date User Action Args
2022-04-10 16:03:50adminsetgithub: 34113
2001-03-07 13:23:44winnegancreate