[Pythonmac-SIG] urllib2 error
Alastair Rankine
arsptr at optusnet.com.au
Fri Jul 8 01:57:22 CEST 2005
Hi,
I just installed MacPython 2.4.1 and TigerPython24Fix from
http://undefined.org/python/ onto my Tiger system. All is not well with
the urllib2 module:
$ python
Python 2.4.1 (#2, Mar 31 2005, 00:05:10)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib2
>>> urllib2.urlopen("http://www.python.org")
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py",
line 130, in urlopen
return _opener.open(url, data)
File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py",
line 358, in open
response = self._open(req, data)
File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py",
line 376, in _open
'_open', req)
File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py",
line 337, in _call_chain
result = func(*args)
File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py",
line 1021, in http_open
return self.do_open(httplib.HTTPConnection, req)
File
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py",
line 996, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error (7, 'No address associated with nodename')>
>>>
This does not seem to be a problem with my network:
$ host www.python.org
www.python.org is an alias for fang.python.org.
fang.python.org has address 194.109.137.226
Nor with Apple's python 2.3:
$ /usr/bin/python
Python 2.3.5 (#1, Mar 20 2005, 20:38:20)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib2
>>> urllib2.urlopen("http://www.python.org")
<addinfourl at 4741400 whose fp = <socket._fileobject object at 0x52d50>>
>>>
Seems like something pretty fundamentally wrong is going on here. Any
suggestions?
More information about the Pythonmac-SIG
mailing list