[Tutor] Marry Xmas + httplib.py problem :)

Dave S pythontut at pusspaws.net
Fri Dec 24 21:19:47 CET 2004


First, merry Xmas everyone, wishing you all well, :-)

While my head is still clear ;-) , I have an unexpected problem.

One of my apps which tracks a ftse website all day has suddenly popped 
up with an exception & exited somewhat ungraciously. This is the second 
time this has occured (512KB Broadband)


bash-2.05b$ ./live_datad.py
Traceback (most recent call last):
  File "./live_datad.py", line 196, in ?
    live_datad()
  File "./live_datad.py", line 189, in live_datad
    ftse_day()
  File "./live_datad.py", line 142, in ftse_day
    new_data=html_strip(load_webpage())
  File "./live_datad.py", line 33, in load_webpage
    url_data=urlopen(HTML_addr)
  File "/usr/lib/python2.3/urllib.py", line 76, in urlopen
    return opener.open(url)
  File "/usr/lib/python2.3/urllib.py", line 181, in open
    return getattr(self, name)(url)
  File "/usr/lib/python2.3/urllib.py", line 297, in open_http
    h.endheaders()
  File "/usr/lib/python2.3/httplib.py", line 712, in endheaders
    self._send_output()
  File "/usr/lib/python2.3/httplib.py", line 597, in _send_output
    self.send(msg)
  File "/usr/lib/python2.3/httplib.py", line 564, in send
    self.connect()
  File "/usr/lib/python2.3/httplib.py", line 532, in connect
    socket.SOCK_STREAM):
IOError: [Errno socket error] (-3, 'Temporary failure in name resolution')
bash-2.05b$


Is this is a DNS problem, if so its very strange since my app has 
downloaded approx 60 web pages from this location today just before the 
exception occured ?, 

or maybe something else ?

Should I check for this exception when I  ...
new_data=html_strip(load_webpage())
& if it occures, try again ?

Any comments gratefully recieved.

Cheers (Hik!)

Dave











More information about the Tutor mailing list