Merge pull request #1617 from ilvalle/issue_1609

fix open file in py3
This commit is contained in:
mdipierro
2017-04-28 08:12:54 -05:00
committed by GitHub
+2 -1
View File
@@ -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'