From 4a41cdb39583925dfbb3809012d2a3b402b55578 Mon Sep 17 00:00:00 2001 From: Vincent Mora Date: Tue, 2 Jul 2019 14:47:00 +0200 Subject: [PATCH] fix infinite loop with python3 --- pglite/pglite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pglite/pglite.py b/pglite/pglite.py index 35da5df..e9461d6 100755 --- a/pglite/pglite.py +++ b/pglite/pglite.py @@ -196,7 +196,7 @@ def import_db(dump_file, db_name): c = read_config() p = subprocess.Popen([os.path.join(os.path.dirname(c['pg_ctl_path']), "psql"), "-h", "localhost", "-p", c['port'], "-d", db_name], stdin = subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE) with open(dump_file, "rb") as fi: - for chunk in iter(lambda: fi.read(2048), ''): + for chunk in iter(lambda: fi.read(2048), b''): p.stdin.write(zd.decompress(chunk)) p.stdin.write(zd.flush()) p.stdin.close()