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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • joemynz@gmail.com

    #1

    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.framewor k/Versions/2.4/lib/python2.4/urllib2.py",
    line 130, in urlopen
    return _opener.open(ur l, data)
    File
    "/opt/local/Library/Frameworks/Python.framewor k/Versions/2.4/lib/python2.4/urllib2.py",
    line 364, in open
    response = meth(req, response)
    File
    "/opt/local/Library/Frameworks/Python.framewor k/Versions/2.4/lib/python2.4/urllib2.py",
    line 471, in http_response
    response = self.parent.err or(
    File
    "/opt/local/Library/Frameworks/Python.framewor k/Versions/2.4/lib/python2.4/urllib2.py",
    line 396, in error
    result = self._call_chai n(*args)
    File
    "/opt/local/Library/Frameworks/Python.framewor k/Versions/2.4/lib/python2.4/urllib2.py",
    line 337, in _call_chain
    result = func(*args)
    File
    "/opt/local/Library/Frameworks/Python.framewor k/Versions/2.4/lib/python2.4/urllib2.py",
    line 554, in http_error_302
    return self.parent.ope n(new)
    File
    "/opt/local/Library/Frameworks/Python.framewor k/Versions/2.4/lib/python2.4/urllib2.py",
    line 358, in open
    response = self._open(req, data)
    File
    "/opt/local/Library/Frameworks/Python.framewor k/Versions/2.4/lib/python2.4/urllib2.py",
    line 376, in _open
    '_open', req)
    File
    "/opt/local/Library/Frameworks/Python.framewor k/Versions/2.4/lib/python2.4/urllib2.py",
    line 337, in _call_chain
    result = func(*args)
    File
    "/opt/local/Library/Frameworks/Python.framewor k/Versions/2.4/lib/python2.4/urllib2.py",
    line 1021, in http_open
    return self.do_open(ht tplib.HTTPConne ction, req)
    File
    "/opt/local/Library/Frameworks/Python.framewor k/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')>

  • Rene Pijlman

    #2
    Re: urlerror, urllib2: &quot;no address&quot; ... why or debug tips?

    joemynz@gmail.c om:[color=blue]
    >Help please with a URLError.[/color]

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

    --
    René Pijlman

    Comment

    Working...