[Tutor] ftplib stalling

orbitz at ezabel.com orbitz at ezabel.com
Fri Mar 5 13:33:27 EST 2004


Hello, I'm using ftplib to download a lot of files from an FTP site.  The
problem is sometimes when I do retrbinary(...) it just stalls indefiniatly.  I
never get a timeout exception or anything.  Right now I am runingit myself and
whenever it appears to stall i just hit ^C and catch the KeyboardInterrupt and
have it restart the connection. I would like to automate this some how. Does
anyone have any suggestions for doing any of the follow (or a better solution):

1) Sending an exception to my program every few seconds that I catch to make it
restart the conn.
2) Some how set a timeout for the socket so I get a timeout exception.
3) A nother FTP module that handles these better. I'm considering twisted but
for right now I'd like to stay away from it for this application but will
deffinatly use it if it is the best solution.


Thanks



More information about the Tutor mailing list