On 7/4/06, Facundo Batista <facundobatista at gmail.com> wrote: > 2006/7/3, Guido van Rossum <guido at python.org>: > > > To fake things like this, socket.setdefaulttimeout() was added, though > > I don't know if it actually works. Have you tried that? > > This affect all the sockets. So, assuming your app is single-threaded, set the timeout, call urlopen(), and reset the timeout to None. > And I hit the problem when servicing > information with a web service (TCPServer), and I need to timeout the > connection of the URLOpen *only*. That's not so easy even if you were to have a timeout parameter to urlopen(). You'd have to implement that peculiarity in all the layers (in this case, urllib and httplib; and possibly ftplib, gopherlib etc. :-) -- --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4