[Patches] [ python-Patches-527518 ] urllib2.py: fix behavior with proxies

noreply@sourceforge.net noreply@sourceforge.net
Wed, 12 Jun 2002 09:41:59 -0700


Patches item #527518, was opened at 2002-03-08 20:50
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=527518&group_id=5470

Category: Library (Lib)
Group: Python 2.1.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Chris Lawrence (lordsutch)
Assigned to: Moshe Zadka (moshez)
Summary: urllib2.py: fix behavior with proxies

Initial Comment:
The following patch against Python 2.1 fixes some
problems with the
urllib2 module when used with proxies; in particular, if
$http_proxy="http://user:passwd@host:port/" is used. 
It also
generates the correct Host header for proxy requests
(some proxies,
such as oops, get confused otherwise, despite RFC 2616
section 5.2
which says they are to ignore it in the case of a full
URL on the
request line).


----------------------------------------------------------------------

Comment By: Bastian Kleineidam (calvin)
Date: 2002-06-12 18:41

Message:
Logged In: YES 
user_id=9205

Note that the proxy thing is also a bug in urllib.py.
Chris, can you supply a patch for urllib.py too?

And I dont like the attached patch because it does not use the
splituser and splitpasswd functions already in urllib. I
would suggest
that you use something like
proxyuser, host = splituser(host)
if proxyuser is not None:
....proxypass, proxyuser = splitpasswd(proxyuser)
....[base64 encode and add header]

Chris, if you are too busy, close this patch and I will open
a new bug with a revised patch.

So long, Bastian

----------------------------------------------------------------------

Comment By: Moshe Zadka (moshez)
Date: 2002-06-11 12:34

Message:
Logged In: YES 
user_id=11645

I want to take a look at this....I'm not thrilled about the
patch, especially solving two unrelated
problems and all, but I do think there's a real problem, and
I'll try to fix it.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=527518&group_id=5470