From 4d117af85f7b764a9dd6bdc0152ae6eea12c2048 Mon Sep 17 00:00:00 2001 From: ilvalle Date: Thu, 27 Apr 2017 18:08:59 +0200 Subject: [PATCH] fix open file in py3, close #1609 --- scripts/cpdb.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/cpdb.py b/scripts/cpdb.py index a04690b1..2e5e949b 100644 --- a/scripts/cpdb.py +++ b/scripts/cpdb.py @@ -15,6 +15,7 @@ except ImportError: import readline try: from gluon import DAL + from gluon.fileutils import open_file except ImportError as err: print('gluon path not found') @@ -531,7 +532,7 @@ class setCopyDB(): self.db.export_to_csv_file(open('tmp.sql', 'wb')) print 'importing data...' - other_db.import_from_csv_file(open('tmp.sql', 'rb')) + other_db.import_from_csv_file(open_file('tmp.sql', 'rb')) other_db.commit() print 'done!' print 'Attention: do not run this program again or you end up with duplicate records'