[Python-Dev] Adding socket timeout to urllib2

Facundo Batista facundo at taniquetil.com.ar
Tue Mar 6 21:56:38 CET 2007


Guido van Rossum wrote:


>> - I'll modify urlopen for it to accept a socket_timeout parameter,
>> default to None
>
> I'd call it timeout. There can't really be much ambiguity can there?

Yes and no. For example, if I do a
``urllib2.urlopen("ftp://ftp.myhome.com.ar/blah.txt", timeout=10)``, the
timeout is about the socket or about the file transfer?


> I say your next step should be to submit a patch, perhaps
> incorporating the work that Skip has already done.

Ok. 


> You could also reduce the amount of work to be done initially by only
> handling http. At this point I expect that'll cover 99% of all uses.

Me too, I suggested ftplib for being cleaner...

Thanks.

-- 
.   Facundo
.
Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/




More information about the Python-Dev mailing list