3798: tempfile wrongly used in Gramps: possible error 'Too many open files: ...'

svn: r15201
This commit is contained in:
Doug Blank 2010-04-17 23:20:01 +00:00
parent fc298c806c
commit 7e5e5db27f

View File

@ -2652,7 +2652,8 @@ def importData(database, filename, callback=None, cl=0):
# Since we don't want to modify the file being imported,
# we create new temp file into which we will copy the imported file
orig_filename = os.path.normpath(filename)
new_filename = tempfile.mkstemp()[1]
new_file_id, new_filename = tempfile.mkstemp()
os.close(new_file_id)
new_env_name = tempfile.mkdtemp()
# determine old env dir and make db work with new env dir