excid3/logbot — Issue #10: Crash on FTP Timeout
Author: smarthall
Created: 2011-12-09 04:02:56+00:00
State: open

When the FTP server closes the connection due to idleness the bot crashes and stops logging. See the following traceback.

Uploading to FTP...
Traceback (most recent call last):
File "logbot.py", line 350, in
main()
File "logbot.py", line 343, in main
bot.start()
File "/home/daniel/src/logbot/ircbot.py", line 247, in start
SimpleIRCClient.start(self)
File "/home/daniel/src/logbot/irclib.py", line 1114, in start
self.ircobj.process_forever()
File "/home/daniel/src/logbot/irclib.py", line 229, in process_forever
self.process_once(timeout)
File "/home/daniel/src/logbot/irclib.py", line 214, in process_once
self.process_data(i)
File "/home/daniel/src/logbot/irclib.py", line 183, in process_data
c.process_data()
File "/home/daniel/src/logbot/irclib.py", line 600, in process_data
self._handle_event(Event(command, prefix, target, arguments))
File "/home/daniel/src/logbot/irclib.py", line 604, in _handle_event
self.irclibobj._handle_event(self, event)
File "/home/daniel/src/logbot/irclib.py", line 325, in _handle_event
if handler[1](connection, event) == "NO MORE":
File "/home/daniel/src/logbot/irclib.py", line 1049, in _dispatcher
getattr(self, m)(c, e)
File "logbot.py", line 282, in on_join
self.write_event("join", e)
File "logbot.py", line 211, in write_event
self.ftp.storbinary("STOR %s" % remote_fname, open(full_fname, "rb"))
File "/usr/lib64/python2.7/ftplib.py", line 453, in storbinary
self.voidcmd('TYPE I')
File "/usr/lib64/python2.7/ftplib.py", line 249, in voidcmd
return self.voidresp()
File "/usr/lib64/python2.7/ftplib.py", line 224, in voidresp
resp = self.getresp()
File "/usr/lib64/python2.7/ftplib.py", line 217, in getresp
raise error_temp, resp
ftplib.error_temp: 421 No transfer timeout (600 seconds): closing control connection