Commit 9f96a8c5 authored by Glandos's avatar Glandos
Browse files

when fixing bytes, retry to convert to str

it seems that sqlite3 is not using text_factory
if the underlying database replies with blob type
parent 7d2c06fa
......@@ -445,7 +445,10 @@ class PostgreSQL(Database):
# Make a dict copy to be able to modify it
rows = [dict(row) for row in rows]
for row in rows:
row[column] = row[column].replace("\x00", "")
old = row[column]
if isinstance(old, bytes):
old = old.decode('utf8', errors='replace')
row[column] = old.replace("\x00", "")
return rows
@property
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment