Skip to content

Commit

Permalink
use replace() over rename() to have cross-platform overwriting (#8148)
Browse files Browse the repository at this point in the history
  • Loading branch information
Duckle29 committed Feb 11, 2020
1 parent 1fed214 commit 310b2f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/python/milc.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ def save_config(self):

# 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)

Expand Down

0 comments on commit 310b2f1

Please sign in to comment.