use replace() over rename() to have cross-platform overwriting (#8148)

refactor_process_record_kb_user 0.7.148
Mikkel Jeppesen 5 years ago committed by GitHub
parent 1fed214490
commit 310b2f1be4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -571,7 +571,7 @@ class MILC(object):
# Move the new config file into place atomically
if os.path.getsize(tmpfile.name) > 0:
os.rename(tmpfile.name, str(self.config_file))
os.replace(tmpfile.name, str(self.config_file))
else:
self.log.warning('Config file saving failed, not replacing %s with %s.', str(self.config_file), tmpfile.name)

Loading…
Cancel
Save