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.

Author mbeachy
Recipients dieresys, mbeachy, orsenthil, ronaldoussoren, tsujikawa
Date 2010-04-13.23:11:40
SpamBayes Score 0.00191869
Marked as misclassified No
Message-id <>
I have worked up a monkey patch for urllib2/httplib for the issue of setting the authentication using a Proxy(Basic|Digest)AuthHandler.

The basic approach was to create a new httplib exception (ProxyTunnelError) and raise that with the http response attached so that the HTTPSHandler can determine when 407 Proxy authentication required is present, and then reroute the urllib2.OpenerDirector to error handling mode.

Unfortunately, there is a backwards compatibility issue - cases where a socket.error was previously being raised now get an ProxyTunnelError. Not that you could do much useful with the socket.error in the first place, but I suppose you could look for '407' in the text. Ugh.

If you think this might prove useful, let me know and I can rework it into a real patch - just let me know what branch/version to base it off of. (My monkey patch is for python 2.6.4.)
Date User Action Args
2010-04-13 23:11:43mbeachysetrecipients: + mbeachy, ronaldoussoren, orsenthil, dieresys, tsujikawa
2010-04-13 23:11:42mbeachysetmessageid: <>
2010-04-13 23:11:40mbeachylinkissue7291 messages
2010-04-13 23:11:40mbeachycreate