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.0019186885
Marked as misclassified No
Message-id <1271200302.34.0.0992478750284.issue7291@psf.upfronthosting.co.za>
In-reply-to
Content
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.)
History
Date User Action Args
2010-04-13 23:11:43mbeachysetrecipients: + mbeachy, ronaldoussoren, orsenthil, dieresys, tsujikawa
2010-04-13 23:11:42mbeachysetmessageid: <1271200302.34.0.0992478750284.issue7291@psf.upfronthosting.co.za>
2010-04-13 23:11:40mbeachylinkissue7291 messages
2010-04-13 23:11:40mbeachycreate