[issue7291] urllib2 cannot handle https with proxy requiring auth

Barry Scott report at bugs.python.org
Mon Feb 21 11:41:27 CET 2011


Barry Scott <barry.scott at onelan.co.uk> added the comment:

The attached patch builds on Mike's work.

The core of the problem is that the Request object
did not know what was going on. This means that it
was not possible for get_authorization() to work
for proxy-auth and www-auth.

I change Request to know which of the four types of
connection it represents. There are new methods on
Request that return the right information based on
the connection type.

To understand how to make this work I needed to
instrument the code. There is now a set_debuglevel
on the OpenerDirector object that turns on debug in
all the handlers and the director. I have added
more debug messages to help understand this code.

This code now passes the 72 test cases I run. I'll
attach the code I used to test as a follow up to this.

----------
nosy: +b.a.scott
Added file: http://bugs.python.org/file20821/http_proxy_https.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7291>
_______________________________________


More information about the Python-bugs-list mailing list