mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 11:02:21 -05:00
Fix for sickragetv/sickrage-issues#247
This commit is contained in:
parent
60e97fb3cc
commit
b667c722f2
@ -73,18 +73,9 @@ class DBConnection(object):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
def _execute(self, query, args):
|
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:
|
try:
|
||||||
if not args:
|
if not args:
|
||||||
return self.connection.cursor().execute(query)
|
return self.connection.cursor().execute(query)
|
||||||
# args = map(convert, args)
|
|
||||||
return self.connection.cursor().execute(query, args)
|
return self.connection.cursor().execute(query, args)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise e
|
raise e
|
||||||
@ -238,7 +229,10 @@ class DBConnection(object):
|
|||||||
return columns
|
return columns
|
||||||
|
|
||||||
def _unicode_text_factory(self, x):
|
def _unicode_text_factory(self, x):
|
||||||
|
try:
|
||||||
return unicode(x, 'utf-8')
|
return unicode(x, 'utf-8')
|
||||||
|
except:
|
||||||
|
return unicode(x, sickbeard.SYS_ENCODING)
|
||||||
|
|
||||||
def _dict_factory(self, cursor, row):
|
def _dict_factory(self, cursor, row):
|
||||||
d = {}
|
d = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user