[Python-Dev] Time-out in URL Open

Guido van Rossum guido at python.org
Wed Jul 5 17:56:25 CEST 2006


OK, you've convinced me. Now where's that SF patch you were promising? :-)

--Guido

On 7/5/06, Facundo Batista <facundobatista at gmail.com> wrote:
> 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/
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org
>


-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list