views:

100

answers:

2

I want Python to ignore Windows proxy settings when using urllib. The only way I managed to do that was disabling all proxy settings on Internet Explorer. Is there any programmatic way?

os.environ['no_proxy'] is not a good option, since I'd like to avoid proxy for all addresses.

A: 

Pass to urlopen method

proxies={}

or try with:

urllib.getproxies = lambda x = None: {}

just after urllib import (Info found here).

systempuntoout
see comment for S.Mark's answer, please
Jaú
Have you tried the second solution?
systempuntoout
A: 

According to document, you could pass, proxies=None or proxies={}

urllib.urlopen(some_url, proxies=None)
S.Mark
Unfortunately, that doesn't work. `proxies=some_value` seems to extend the known proxies list instead of overriding it.
Jaú
@Jaú, How about `os.environ['http_proxy']=None` ?
S.Mark