From 53db127b14e900e6ee0259f0606d608cd4e5bfba Mon Sep 17 00:00:00 2001 From: root Date: Wed, 16 Feb 2022 18:56:53 +0100 Subject: [PATCH] Python3 fixes --- parts/server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/parts/server.py b/parts/server.py index caa9e4a..2d37e50 100644 --- a/parts/server.py +++ b/parts/server.py @@ -75,7 +75,7 @@ def get_locations_in_container(containerID): r = db_engine.execute(text(s), id=containerID) l={} for row in r: - l[row[0]]= row[1]; + l[str(row[0])]= row[1]; r.close() return json.dumps(l) @@ -324,7 +324,8 @@ def connect(user, password, db, host='localhost', port=5432): con = sqlalchemy.create_engine(url, client_encoding='utf8') # We then bind the connection to MetaData() - meta = sqlalchemy.MetaData(bind=con, reflect=True) + meta = sqlalchemy.MetaData(bind=con) + meta.reflect(bind=con) return con, meta