I am using ftplib in some code that does exactly what you would expect. It ftp's files. Its running inside a service running on windows xp and windows 2003 servers, approximately 20 installations each installation sends between 100 and 1000 files per day. Occasionally the process will hang completely and the only way to restart the service is to kill the pythonservice.exe (via End Process in Task Manager) service and start it.
I have turned on the full debugging, ftpobject.debug(1), and redirected that stdout to a file and when the process hangs i see hundreds of identical lines (*cmd* 'TYPE I') in the debug files. See log except below. This command i see is only executed in two places, during the storbinary and retrbinary methods. When it hangs, it never gets a response from the server and eventually locks up. The connection does have a socket timeout of 10 seconds on the connection, modifying the length of time has no affect on this issue. Everything will work fine for weeks/months and then all of a sudden a network issue will occur and the process will hang. The process ONLY hangs when transferring over the internet, it has never happened on a LAN connection, even when i have removed all connectivity from the FTP server mid upload. Has anyone ever seen this? or have any ideas how i could code around it. Thanks Jeff --- debug log ---- *resp* '227 Entering Passive Mode (##.##.##.##,173,244).' *cmd* 'NLST *filematch*.xml' *resp* '125 Data connection already open; Transfer starting.' *resp* '226 Transfer complete.' *cmd* 'USER username' *resp* '331 Password required for username.' *cmd* 'PASS ********' *resp* '230 User username logged in.' *cmd* 'TYPE I' *resp* '200 Type set to I.' *cmd* 'PASV' *resp* '227 Entering Passive Mode (##.##.##.##,174,4).' *cmd* u'STOR /path/to/filename.ext' *resp* '125 Data connection already open; Transfer starting.' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' *cmd* 'TYPE I' .... you get the idea -- http://mail.python.org/mailman/listinfo/python-list