Karma: allow for karma/query on unicode strings

This commit is contained in:
Brian S. Stephan 2011-02-20 16:13:00 -06:00
parent ca0ee4ce41
commit 578c2ea29f
1 changed files with 2 additions and 2 deletions

View File

@ -135,7 +135,7 @@ class Karma(Module):
INSERT INTO karma_log (key, delta, who, userhost)
VALUES (?, ?, ?, ?)
'''
conn.execute(sql, (key, value, nick, userhost))
conn.execute(sql, (key.decode('utf-8', 'ignore'), value, nick, userhost))
conn.commit()
except sqlite3.Error as e:
conn.rollback()
@ -216,7 +216,7 @@ class Karma(Module):
FROM karma_values
WHERE key = :key
'''
value = conn.execute(query, {'key': key}).fetchone()
value = conn.execute(query, {'key': key.decode('utf-8', 'ignore')}).fetchone()
if (value != None):
query = '''