* src/ReadXML.py (import_data), src/WriteXML.py (export_data),
src/RelImage.py (import_media_object), src/gramps_main.py (open_example), src/plugins/Check.py (cleanup_missing_photos), src/plugins/WebPage.py (write_gallery): Change shutil.copy() calls to first call shutil.copyfile() and then try setting up bits. svn: r1652
This commit is contained in:
@ -65,7 +65,11 @@ except:
|
||||
#-------------------------------------------------------------------------
|
||||
def exportData(database, filename, callback):
|
||||
if os.path.isfile(filename):
|
||||
shutil.copy(filename, filename + ".bak")
|
||||
shutil.copyfile(filename, filename + ".bak")
|
||||
try:
|
||||
shutil.copystat(filename, filename + ".bak")
|
||||
except:
|
||||
pass
|
||||
|
||||
compress = GrampsCfg.uncompress == 0 and _gzip_ok == 1
|
||||
|
||||
@ -78,7 +82,11 @@ def exportData(database, filename, callback):
|
||||
DisplayTrace.DisplayTrace()
|
||||
ErrorDialog(_("Failure writing %s") % filename,
|
||||
_("An attempt is being made to recover the original file"))
|
||||
shutil.copy(filename + ".bak", filename)
|
||||
shutil.copyfile(filename + ".bak", filename)
|
||||
try:
|
||||
shutil.copystat(filename + ".bak", filename)
|
||||
except:
|
||||
pass
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
Reference in New Issue
Block a user