diff --git a/python/ray/tune/trial_runner.py b/python/ray/tune/trial_runner.py index e27678d32..f2b66e7c1 100644 --- a/python/ray/tune/trial_runner.py +++ b/python/ray/tune/trial_runner.py @@ -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: