httplib / connection

rhXX rh00667 at gmail.com
Tue Jun 12 14:09:12 CEST 2007


hi all,

i'm using this tutorial example

import httplib

h = httplib.HTTP("www.python.org")
h.putrequest('GET','/index.html')
h.putheader('User-Agent','Lame Tutorial Code')
h.putheader('Accept','text/html')
h.endheaders()

errcode,errmsg, headers = h.getreply()
f = h.getfile() # Get file object for reading data
data = f.read()
f.close()

but always i get this tracing error, a timeout in h.endheaders()


  File "ejemplo.py", line 331, in testA
    h.endheaders()

  File ".../lib/python2.4/httplib.py", line 795, in endheaders
    self._send_output()

  File ".../lib/python2.4/httplib.py", line 676, in _send_output
    self.send(msg)

  File ".../lib/python2.4/httplib.py", line 643, in send
    self.connect()

  File ".../lib/python2.4/httplib.py", line 627, in connect
    raise socket.error, msg

socket.error: (110, 'Connection timed out')

must i do something about network before????

i would appreciate ur commenst




More information about the Python-list mailing list