Python 2.6 ftplib has timeout parameter, but how to detect a timeout

Giampaolo Rodola' gnewsg at gmail.com
Wed Dec 30 07:21:56 EST 2009


On 14 Dic, 20:08, Brendan <brendandetra... at yahoo.com> wrote:
> I was quite happy to see that ftplib in Python 2.6 now has a timeout
> parameter. With large file downloads my script would often hang,
> presumably from timing out. Now that there is a timeout parameter, how
> would I detect when a timeout occurs?

The socket object will raise a timeout exception during recv() or send
().


--- Giampaolo
http://code.google.com/p/pyftpdlib



More information about the Python-list mailing list