[tune] os.replace() instead of os.rename() for cross-platform (#9141)

Co-authored-by: Mehrdad <noreply@github.com>
This commit is contained in:
mehrdadn
2020-06-25 12:30:51 -07:00
committed by GitHub
parent 0bfcc2e5ba
commit 07655036d2
+1 -1
View File
@@ -276,7 +276,7 @@ class TrialRunner:
with open(tmp_file_name, "w") as f:
json.dump(runner_state, f, indent=2, cls=_TuneFunctionEncoder)
os.rename(tmp_file_name, self.checkpoint_file)
os.replace(tmp_file_name, self.checkpoint_file)
if force:
self._syncer.sync_up()
else: