We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2dba7e2 commit a7f270fCopy full SHA for a7f270f
diplomat/predictors/sfpe/file_io.py
@@ -614,9 +614,11 @@ def commit(self):
614
# Windows does some weird stuff here... We fallback to the 'unsafe' option...
615
try:
616
os.remove(self._final_path)
617
- except FileNotFoundError:
618
- pass
619
- os.rename(self._commiter_path, self._final_path)
+ os.rename(self._commiter_path, self._final_path)
+ except (FileNotFoundError, PermissionError) as e:
+ print(f"Unable to remove the file due to {e}")
620
+ shutil.copyfile(self._commiter_path, self._final_path)
621
+
622
623
# Reset edit info...
624
self._last_flush = time.monotonic()
0 commit comments