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).