1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Using unicode for name keys now in NameParser cache, resolves 8-byte error.

This commit is contained in:
echel0n 2014-07-15 11:51:40 -07:00
parent c577ff2887
commit 89c8ed4372

View File

@ -611,7 +611,8 @@ class NameParserCache:
self.npc_cache_size = 200
def add(self, name, parse_result):
name = name.encode('utf-8', 'ignore')
if not isinstance(name, unicode):
name = unicode(name, 'utf-8', 'replace')
try:
with closing(Shove('sqlite:///' + self.db_name, compress=True)) as npc:
@ -631,7 +632,8 @@ class NameParserCache:
logger.log(u"NameParser cache error: " + ex(e), logger.ERROR)
def get(self, name):
name = name.encode('utf-8', 'ignore')
if not isinstance(name, unicode):
name = unicode(name, 'utf-8', 'replace')
try:
with closing(Shove('sqlite:///' + self.db_name, compress=True)) as npc: