Another try to fix JSON issues.
parent
aeb4867bdf
commit
b9cbf08b51
|
@ -26,7 +26,8 @@ class DataTypeJSONEncoder(json.JSONEncoder):
|
|||
return (datetime.datetime.min + obj).time().isoformat()
|
||||
if isinstance(obj, decimal.Decimal):
|
||||
return float(obj)
|
||||
|
||||
if isinstance(obj, bytes):
|
||||
return obj.decode('utf-8')
|
||||
try:
|
||||
retval = json.JSONEncoder.default(self, obj)
|
||||
except TypeError:
|
||||
|
|
|
@ -1987,6 +1987,8 @@ Failed to reset the connection to the server due to following error:
|
|||
|
||||
if parameters:
|
||||
mogrified_sql = cursor.mogrify(query, parameters)
|
||||
if isinstance(mogrified_sql, bytes):
|
||||
mogrified_sql = mogrified_sql.decode(self.python_encoding)
|
||||
return mogrified_sql
|
||||
else:
|
||||
return query
|
||||
|
|
Loading…
Reference in New Issue