diff --git a/plugins/Quotes.py b/plugins/Quotes.py index 4d1ef41d2..22bb8d75b 100644 --- a/plugins/Quotes.py +++ b/plugins/Quotes.py @@ -82,7 +82,7 @@ class QuoteRecord(object): class SqliteQuotesDB(object): def _getDb(self, channel): - filename = plugins.makeChannelFilename('Quotes.db', channel) + filename = plugins.makeChannelFilename(channel, 'Quotes.db') if os.path.exists(filename): return sqlite.connect(db=filename, mode=0755, converters={'bool': bool}) diff --git a/plugins/__init__.py b/plugins/__init__.py index d1e63c105..f7466afb8 100644 --- a/plugins/__init__.py +++ b/plugins/__init__.py @@ -111,6 +111,8 @@ class DBHandler(object): def makeChannelFilename(channel, filename, dirname=None): + assert ircutils.isChannel(channel), 'channel not a channel, ' \ + 'the arguments to makeChannelFilename are probably reversed.' assert filename == os.path.basename(filename), 'We don\'t handle dirs.' channel = ircutils.toLower(channel) if conf.supybot.databases.plugins.channelSpecific.get(channel)():