mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Another try to fix JSON issues.
This commit is contained in:
parent
aeb4867bdf
commit
b9cbf08b51
@ -26,7 +26,8 @@ class DataTypeJSONEncoder(json.JSONEncoder):
|
|||||||
return (datetime.datetime.min + obj).time().isoformat()
|
return (datetime.datetime.min + obj).time().isoformat()
|
||||||
if isinstance(obj, decimal.Decimal):
|
if isinstance(obj, decimal.Decimal):
|
||||||
return float(obj)
|
return float(obj)
|
||||||
|
if isinstance(obj, bytes):
|
||||||
|
return obj.decode('utf-8')
|
||||||
try:
|
try:
|
||||||
retval = json.JSONEncoder.default(self, obj)
|
retval = json.JSONEncoder.default(self, obj)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
@ -1987,6 +1987,8 @@ Failed to reset the connection to the server due to following error:
|
|||||||
|
|
||||||
if parameters:
|
if parameters:
|
||||||
mogrified_sql = cursor.mogrify(query, parameters)
|
mogrified_sql = cursor.mogrify(query, parameters)
|
||||||
|
if isinstance(mogrified_sql, bytes):
|
||||||
|
mogrified_sql = mogrified_sql.decode(self.python_encoding)
|
||||||
return mogrified_sql
|
return mogrified_sql
|
||||||
else:
|
else:
|
||||||
return query
|
return query
|
||||||
|
Loading…
Reference in New Issue
Block a user