From 126b67c9634c08166769233e1c43a1e7bf2b100a Mon Sep 17 00:00:00 2001 From: Dan Stoner Date: Wed, 16 Jun 2021 20:55:46 -0400 Subject: [PATCH] python3 uses BytesIO for bytes --- idb/postgres_backend/db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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):