use replace() over rename() to have cross-platform overwriting (#8148)
This commit is contained in:
parent
1fed214490
commit
310b2f1be4
1 changed files with 1 additions and 1 deletions
|
@ -571,7 +571,7 @@ class MILC(object):
|
||||||
|
|
||||||
# Move the new config file into place atomically
|
# Move the new config file into place atomically
|
||||||
if os.path.getsize(tmpfile.name) > 0:
|
if os.path.getsize(tmpfile.name) > 0:
|
||||||
os.rename(tmpfile.name, str(self.config_file))
|
os.replace(tmpfile.name, str(self.config_file))
|
||||||
else:
|
else:
|
||||||
self.log.warning('Config file saving failed, not replacing %s with %s.', str(self.config_file), tmpfile.name)
|
self.log.warning('Config file saving failed, not replacing %s with %s.', str(self.config_file), tmpfile.name)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue