urllib timeout
MRAB
python at mrabarnett.plus.com
Tue Jul 27 18:23:25 EDT 2010
kBob wrote:
>
> I created a script to access weather satellite imagery fron NOAA's
> ADDS.
>
> It worked fine until recently with Python 2.6.
>
> The company changed the Internet LAN connections to "Accept Automatic
> settings" and "Use automatic configuration script"
>
> How do you get urllib.urlopen to use the the "automatic script"
> configuration?
>
> This code worked recently, until the company implemented these LAN
> connections...
>
> SAT_URL = "http://adds.aviationweather.gov/data/satellite/
> latest_BWI_vis.jpg"
> satpic = urllib.urlopen(SAT_URL, proxies=0 )
> satimg = satpic.read()
>
For the record, I got:
>>> import urllib
>>> SAT_URL =
"http://adds.aviationweather.gov/data/satellite/latest_BWI_vis.jpg"
>>> satpic = urllib.urlopen(SAT_URL, proxies=0 )
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python26\lib\urllib.py", line 79, in urlopen
opener = FancyURLopener(proxies=proxies)
File "C:\Python26\lib\urllib.py", line 617, in __init__
URLopener.__init__(self, *args, **kwargs)
File "C:\Python26\lib\urllib.py", line 129, in __init__
assert hasattr(proxies, 'has_key'), "proxies must be a mapping"
AssertionError: proxies must be a mapping
However, urllib.urlretrieve(...) works.
More information about the Python-list
mailing list