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 xelnor
Recipients xelnor
Date 2009-09-12.10:12:25
SpamBayes Score 5.551115e-17
Marked as misclassified No
Message-id <1252750349.64.0.743075601539.issue6894@psf.upfronthosting.co.za>
In-reply-to
Content
I discovered recently that urllib2 doesn't respect the "no_proxy" 
environment variable on linux (and on other platforms too, I think).

Here is an example of the problem :
- Set http_proxy and no_proxy environment variables (for instance 
no_proxy="localhost")

proxy_handler = urllib2.ProxyHandler()
opener = urllib2.build_opener(proxy_handler)
urllib2.install_opener(opener)

and then open an "outside" url : everything is OK (urllib2 reads 
correctly http_proxy), but for "localhost", it tries to open it 
through the proxy.

You would expect urllib2 to understand no_proxy, all the more since 
all the needed code is already available in urllib.

I have prepared a patch for urllib2 which does correct that bug.

I don't have other versions of python installed, so I couldn't check 
that se bug is still present there.
History
Date User Action Args
2009-09-12 10:12:29xelnorsetrecipients: + xelnor
2009-09-12 10:12:29xelnorsetmessageid: <1252750349.64.0.743075601539.issue6894@psf.upfronthosting.co.za>
2009-09-12 10:12:27xelnorlinkissue6894 messages
2009-09-12 10:12:27xelnorcreate