A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-July/067026.html below:

[Python-Dev] Time-out in URL Open

[Python-Dev] Time-out in URL OpenFacundo Batista facundobatista at gmail.com
Wed Jul 5 17:51:47 CEST 2006
2006/7/4, Guido van Rossum <guido at python.org>:

> > This affect all the sockets.
>
> So, assuming your app is single-threaded, set the timeout, call
> urlopen(), and reset the timeout to None.

No, it's multithreaded, :D


> > 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.
> :-)

Yes, it's not SO easy, because, as you said, you have to dig into the
layers until you hit the actual socket creation and modify the timeout
for that socket only.

That's why I think that this should be handled in the standard library
and not left to implement to whoever will need it, :)

-- 
.    Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/
More information about the Python-Dev mailing list

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