Catch script hangs
Bakes
bakes at ymail.com
Sun Sep 27 18:40:50 EDT 2009
Due to an ftp server issue, my python script sometimes hangs whilst
downloading, unable to receive any more data. Is there any way that I
could have python check, maybe through a thread or something, whether
it has hanged (or just, if it's still active after 10 seconds, stop
it?). I have looked at threading but there does not seem to be a stop
method on threading, which is a problem. Could the lower level thread
module be a solution?
I was thinking something like:
thread:
spawn threaded timer, if it gets to 20, close the thread
attempt download of file
cancel threaded timer.
exit thread.
would that work at all?
More information about the Python-list
mailing list