Explorar el Código

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

Mikkel Jeppesen hace 5 años
padre
commit
310b2f1be4
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      lib/python/milc.py

+ 1 - 1
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)