From 310b2f1be43a9faa8599f143b459ae43e55393a4 Mon Sep 17 00:00:00 2001
From: Mikkel Jeppesen <2756925+Duckle29@users.noreply.github.com>
Date: Tue, 11 Feb 2020 10:37:15 +0100
Subject: [PATCH] use replace() over rename() to have cross-platform
 overwriting (#8148)

---
 lib/python/milc.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/python/milc.py b/lib/python/milc.py
index 36072ca764..949bb0252a 100644
--- a/lib/python/milc.py
+++ b/lib/python/milc.py
@@ -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)