urllib2 : https and proxy

cp.finances.gouv at gmail.com cp.finances.gouv at gmail.com
Mon Jul 2 11:32:08 CEST 2007


On 2 juil, 05:04, "O.R.Senthil Kumaran"
<orsent... at users.sourceforge.net> wrote:
> * Maric Michaud <m... at aristote.info> [2007-06-28 23:38:39]:
>
> >  Hmmm, i've tried something similar but I get the same result.
>
> >  For the code example I gave, I've put correctly the http_proxy and
> >  https_proxy environment variables, the default ProxyHandler get them right
> >  as this is the proxy itself which returns the error. I checked this with
> >  wireshark, the proxy said that there is incompatibilities in some request
> >  methods, like POST, with some protocols, Gopher is the example it gave.
> >  That doesn't make much sense to me as the wget command I tried is intended
> >  to do exactly the same thing (POST over https and retrieve some cookies from
> >  the response), and go through with no problems.
>
> Maric, in the ActiveState urllib2 HOWTO which seems to apply for Python 2.5, I
> came across a point which mentions urllib2 does not support PROXY for HTTPS.

Yes, I realize this too, I think this should be considered as a bug in
the documentation.

> Your case seems the same, I would suggest you to look up the Python Tracker
> for any already open issues, or if not kindly log one yourself.


Didn't find one when i made a quick search, but i would suggest to
submit a documentation bug.

BTW, I find this recipe on python cookbook,
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/456195,
works fine for me (with the two additionals comments in my case). We
could add a pointer to this in the doc before fixing urllib2.

What would you suggest ?



> --
> O.R.Senthil Kumaranhttp://uthcode.sarovar.org





More information about the Python-list mailing list