_extract_filename fails during DNS resolution

Bug #712989 reported by David Blewett
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PyPI Mirror
New
Undecided
Unassigned

Bug Description

Get the following traceback if the external hostname doesn't resolve:

2011-02-04 05:29:34,907 DEBUG Processing package pthy
2011-02-04 05:29:35,379 DEBUG Head-Request to get filename for http://pthy.python-hosting.com/attachment/wiki/PthyReleases/pthy-0.5.tar.gz?rev=&format=raw.
Traceback (most recent call last):
  File "./bin/pypimirror", line 15, in <module>
    z3c.pypimirror.mirror.run()
  File "/usr/home/davidb/.buildout/eggs/z3c.pypimirror-1.0.16-py2.6.egg/z3c/pypimirror/mirror.py", line 824, in run
    config["base_url"])
  File "/usr/home/davidb/.buildout/eggs/z3c.pypimirror-1.0.16-py2.6.egg/z3c/pypimirror/mirror.py", line 482, in mirror
    filename = self._extract_filename(url)
  File "/usr/home/davidb/.buildout/eggs/z3c.pypimirror-1.0.16-py2.6.egg/z3c/pypimirror/mirror.py", line 561, in _extract_filename
    conn.request('HEAD', fetch_url)
  File "/usr/local/lib/python2.6/httplib.py", line 898, in request
    self._send_request(method, url, body, headers)
  File "/usr/local/lib/python2.6/httplib.py", line 935, in _send_request
    self.endheaders()
  File "/usr/local/lib/python2.6/httplib.py", line 892, in endheaders
    self._send_output()
  File "/usr/local/lib/python2.6/httplib.py", line 764, in _send_output
    self.send(msg)
  File "/usr/local/lib/python2.6/httplib.py", line 723, in send
    self.connect()
  File "/usr/local/lib/python2.6/httplib.py", line 704, in connect
    self.timeout)
  File "/usr/local/lib/python2.6/socket.py", line 500, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.gaierror: [Errno 8] hostname nor servname provided, or not known

Revision history for this message
David Blewett (david.blewett) wrote :
Revision history for this message
David Blewett (david.blewett) wrote :

This is a pretty simple fix, and if not done people's mirrors will be falling behind as the script just errors out completely if the external hostname cannot be resolved.

The package in question is:
http://pypi.python.org/pypi/pthy

Revision history for this message
Low Kian Seong (kianseong) wrote :

Your patch has been intergrated into the main line

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.