From b667c722f2ff05975bde8fb1dec9579c3112beab Mon Sep 17 00:00:00 2001 From: echel0n Date: Sun, 21 Dec 2014 09:28:20 -0800 Subject: [PATCH] Fix for sickragetv/sickrage-issues#247 --- sickbeard/db.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sickbeard/db.py b/sickbeard/db.py index 1d633b08..8b119054 100644 --- a/sickbeard/db.py +++ b/sickbeard/db.py @@ -73,18 +73,9 @@ class DBConnection(object): raise def _execute(self, query, args): - def convert(x): - if isinstance(x, basestring): - try: - x = unicode(x).decode(sickbeard.SYS_ENCODING) - except: - pass - return x - try: if not args: return self.connection.cursor().execute(query) - # args = map(convert, args) return self.connection.cursor().execute(query, args) except Exception as e: raise e @@ -238,7 +229,10 @@ class DBConnection(object): return columns def _unicode_text_factory(self, x): - return unicode(x, 'utf-8') + try: + return unicode(x, 'utf-8') + except: + return unicode(x, sickbeard.SYS_ENCODING) def _dict_factory(self, cursor, row): d = {}