diff --git a/idb/postgres_backend/db.py b/idb/postgres_backend/db.py index 4753f41..bf55196 100644 --- a/idb/postgres_backend/db.py +++ b/idb/postgres_backend/db.py @@ -7,7 +7,7 @@ import itertools from datetime import datetime -from io import StringIO +from io import BytesIO from psycopg2.extras import DictCursor, NamedTupleCursor from psycopg2.extensions import cursor @@ -684,7 +684,7 @@ def fromuuid(cls, uuid, idbmodel=None): @classmethod def frombuff(cls, buff, **attrs): - return cls.fromobj(StringIO(buff), **attrs) + return cls.fromobj(BytesIO(buff), **attrs) @classmethod def fromobj(cls, obj, **attrs):