Re: urllib2 : https and proxy



On 2 juil, 05:04, "O.R.Senthil Kumaran"
<orsent...@xxxxxxxxxxxxxxxxxxxxx> wrote:
* Maric Michaud <m...@xxxxxxxxxxxxx> [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


.



Relevant Pages

  • Re: urllib2 through basic authed proxy
    ... I finally installed squid and had a look at the urllib2 proxy ... tested with a perhaps-broken 2.5 install, ... ProxyHandler in an attempt to fix the URL host:post syntax! ...
    (comp.lang.python)
  • urllib2 : https and proxy
    ... I'm facing a strange behavior of urllib2 trying to access gmail ... While the following urllib2 code fail with an error 501: ... I understood it's a response from the proxy about incompatible ...
    (comp.lang.python)
  • urllib2, proxies and https
    ... the example of its working code: ... I can use urllib2 via proxy to access a https site. ...
    (comp.lang.python)
  • urllib2 and proxies support ?
    ... I've a problem using urllib2 with a proxy which need authentication. ...
    (comp.lang.python)