Fixed escaping IOError from add command.

This commit is contained in:
Jeremy Fincher 2003-11-19 22:36:58 +00:00
parent 909597b7ac
commit c17f85e51b
2 changed files with 10 additions and 2 deletions

View File

@ -130,8 +130,8 @@ class Lookup(callbacks.Privmsg):
try:
filename = os.path.join(conf.dataDir, filename)
fd = file(filename)
except OSError, e:
irc.error('Could open %s: %s' % (filename, e))
except EnvironmentError, e:
irc.error('Could not open %s: %s' % (filename, e))
return
cursor.execute("""CREATE TABLE %s (key TEXT, value TEXT)""" % name)
sql = """INSERT INTO %s VALUES (%%s, %%s)""" % name

View File

@ -33,6 +33,11 @@ from test import *
import os
try:
import sqlite
except ImportError:
sqlite = None
import conf
class LookupTestCase(PluginTestCase, PluginDocumentation):
@ -64,6 +69,9 @@ class LookupTestCase(PluginTestCase, PluginDocumentation):
self.assertError('test foo')
finally:
conf.replyWhenNotCommand = original
def testNotEscapingIOError(self):
self.assertNotRegexp('lookup add foo asdlfkjsdalfkj', 'IOError')