timeout in urllib.open()

Peter Otten __peter__ at web.de
Mon Feb 19 05:55:35 EST 2007


Stefan Palme wrote:

(top-posting undone)

[Peter]
>> I believe this can only be set globally:
>> 
>> import socket
>> socket.setdefaulttimeout(seconds)

[Stefan]
> Uuuh this is no solution for me, because the
> website-checking tool is part of a very very big
> application running in an application server, so
> globally setting the timeout may break a lot of
> other things...
> 
> But when there is a "default timeout" (as indicated by
> the method name) - isn't there a "per-socket timeout"
> too?

Yes, but it isn't as easily available...

Perhaps you find some ideas here:

http://mail.python.org/pipermail/python-dev/2007-February/070897.html

Peter




More information about the Python-list mailing list