[Tutor] Python urllib (linux)

Patty patriciap.gu at gmail.com
Fri Jun 30 15:58:03 CEST 2006


Hi all,
I'm doing some failure testing for a python script that uses urllib and  urllib2
to open a web page and post data. If the server's apache is down or if I change
the ip address the script is trying to contact to be a bogus address, the script
handles it prefectly. When I unplug the ethernet cable from my machine (client),
the script hangs. Is there a way I can implement a timeout to handle this 
problem?
I'd appreciate any suggestions because I'm clueless.
Thanks,
Patty



More information about the Tutor mailing list