Pathoschild / stewbot

A Python IRC script which automates interactions with MediaWiki wikis based on commands given by users on IRC; primarily intended for Wikimedia steward or administrator operations, but work is being done to enable Wikia and generic wiki use.
http://meta.wikimedia.org/wiki/StewardBot
ISC License
14 stars 5 forks source link

Error-handling crashes if dump file path is invalid (Was: Stewardbot crashes when doing help command) #3

Closed Pathoschild closed 14 years ago

Pathoschild commented 14 years ago

The following issue was logged by Bsadowski1, and recreated manually when the repository had to be recreated.

Python version: 2.6 Windows Command used: &help access Full trace: Traceback (most recent call last): File "init.py", line 31, in

bot.processForever() File "C:\Program Files\stewbot\stewardbot\Stewardbot.py", line 102, in process Forever self.irc.processForever() File "../modules\IRC.py", line 77, in processForever

self.irc.process_forever() File "C:\Python26\lib\site-packages\python_irclib-0.4.6-py2.6.egg\irclib.py", line 229, in process_forever self.process_once(timeout) File "C:\Python26\lib\site-packages\python_irclib-0.4.6-py2.6.egg\irclib.py", line 214, in process_once self.process_data(i) File "C:\Python26\lib\site-packages\python_irclib-0.4.6-py2.6.egg\irclib.py", line 183, in process_data c.process_data() File "C:\Python26\lib\site-packages\python_irclib-0.4.6-py2.6.egg\irclib.py", line 571, in process_data self._handle_event(Event(command, prefix, target, [m])) File "C:\Python26\lib\site-packages\python_irclib-0.4.6-py2.6.egg\irclib.py", line 594, in _handle_event self.irclibobj._handle_event(self, event) File "C:\Python26\lib\site-packages\python_irclib-0.4.6-py2.6.egg\irclib.py", line 326, in _handle_event if handler[1](connection, event) == "NO MORE": File "../modules\IRC.py", line 230, in onPublicMessage

self.callback_pubmsg( self.Message(conn, event) ) File "C:\Program Files\stewbot\stewardbot\Stewardbot.py", line 165, in onPubli cMessage dump = open( config['debug']['dump_file'], 'w' ) IOError: [Errno 2] No such file or directory: '/home/pathoschild/public_html/ste wardbot/dump'

Pathoschild commented 14 years ago

This is a configuration problem. In config.py, find the string "/home/pathoschild/". That is the directory it stores its error dumps. Change that to a path on its current machine, eg "/logs".

(We should add code to handle this more gracefully or validate on startup before closing this issue.)

Pathoschild commented 14 years ago

Done in 7ddb37244063164018829901fb38dd2851dd4164.