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: urllib2.ProxyHandler broken recently for non-userinfo case
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, jjlee
Priority: normal Keywords: patch

Created on 2006-04-01 20:33 by jjlee, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
proxyhandler.patch jjlee, 2006-04-01 20:33
Messages (2)
msg49933 - (view) Author: John J Lee (jjlee) Date: 2006-04-01 20:33
urllib2.ProxyHandler was broken by rev 42133, for
authorities that do not contain a userinfo component
(i.e. when the joe:password bit in
joe:password@host:port is missing).

Example code to trigger the bug (raises TypeError):

import urllib2
proxy_handler = urllib2.ProxyHandler({"http":
"localhost:3128"})
urllib2.build_opener(proxy_handler).open('http://python.org/')


The patch allows use of the :port notation as 42133
intended, but preserves correct userinfo handling.

The patch also adds a unit test for ProxyHandler, and a
doctest for parsing of proxy specification strings
(which may either be a URL with authority or just an
authority).
msg49934 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-04-02 20:45
Logged In: YES 
user_id=849994

Patch looks good (and comes with test, which is very
important for code quality). Thanks very much!

(rev. 43553)
History
Date User Action Args
2022-04-11 14:56:16adminsetgithub: 43143
2006-04-01 20:33:07jjleecreate