471,119 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,119 software developers and data experts.

urlerror, urllib2: "no address" ... why or debug tips?

Help please with a URLError. Invoking a url that works in Firefox and
IE results in a "urlerror 7, no address ..." in python. I need to debug
why.

Traceback is below. There's a redirect when the url is invoked (it's
part of a chain) - you can see it using liveheaders in firefox. What is
the best way to debug this? I tried setting debug on HTTPConnection but
this doesn't work (from some web posts, setting debug is broken in
2.4). What's the best way to see what's happening, way to monitor the
call sequences etc?

Any help much appreciated. Thx.

handle = urllib2.urlopen(req)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py",
line 130, in urlopen
return _opener.open(url, data)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py",
line 364, in open
response = meth(req, response)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py",
line 471, in http_response
response = self.parent.error(
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py",
line 396, in error
result = self._call_chain(*args)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py",
line 337, in _call_chain
result = func(*args)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py",
line 554, in http_error_302
return self.parent.open(new)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py",
line 358, in open
response = self._open(req, data)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py",
line 376, in _open
'_open', req)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py",
line 337, in _call_chain
result = func(*args)
File
"/opt/local/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
"/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py",
line 996, in do_open
raise URLError(err)
URLError: <urlopen error (7, 'No address associated with nodename')>

Mar 10 '06 #1
1 2249
jo*****@gmail.com:
Help please with a URLError.


Post your code (a small self-contained example, preferrably) and the URL.

--
René Pijlman
Mar 10 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by aerobar2 | last post: by
134 posts views Thread by James A. Donald | last post: by
3 posts views Thread by Lou | last post: by
10 posts views Thread by RDI | last post: by
reply views Thread by Alex B. | last post: by
8 posts views Thread by Steve Kershaw | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.