fix open file in py3, close #1609
This commit is contained in:
+2
-1
@@ -15,6 +15,7 @@ except ImportError:
|
|||||||
import readline
|
import readline
|
||||||
try:
|
try:
|
||||||
from gluon import DAL
|
from gluon import DAL
|
||||||
|
from gluon.fileutils import open_file
|
||||||
except ImportError as err:
|
except ImportError as err:
|
||||||
print('gluon path not found')
|
print('gluon path not found')
|
||||||
|
|
||||||
@@ -531,7 +532,7 @@ class setCopyDB():
|
|||||||
self.db.export_to_csv_file(open('tmp.sql', 'wb'))
|
self.db.export_to_csv_file(open('tmp.sql', 'wb'))
|
||||||
|
|
||||||
print 'importing data...'
|
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()
|
other_db.commit()
|
||||||
print 'done!'
|
print 'done!'
|
||||||
print 'Attention: do not run this program again or you end up with duplicate records'
|
print 'Attention: do not run this program again or you end up with duplicate records'
|
||||||
|
|||||||
Reference in New Issue
Block a user