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

Aahz aahz at pythoncraft.com
Wed Dec 30 00:38:30 EST 2009


In article <d2ee7a63-a3af-433a-a40f-fc539bd61010 at x15g2000vbr.googlegroups.com>,
Brendan  <brendandetracey 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?

Without looking at code or docs, I assume you get an exception.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Weinberg's Second Law: If builders built buildings the way programmers wrote 
programs, then the first woodpecker that came along would destroy civilization.



More information about the Python-list mailing list