Skip to content

Commit

Permalink
Fix allegroai#1348 by replacing os.replace with shutils.move
Browse files Browse the repository at this point in the history
  • Loading branch information
Octoslav committed Nov 19, 2024
1 parent 036d7b6 commit 1aff2a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clearml/binding/artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import pickle
from six.moves.urllib.parse import quote
from shutil import move
from copy import deepcopy
from datetime import datetime
from multiprocessing.pool import ThreadPool
Expand Down Expand Up @@ -1138,7 +1139,7 @@ def _pop_temp_file(self, local_filename=None):
temp_folder, prefix, suffix = self._temp_files_lookup.pop(local_filename)
fd, temp_filename = mkstemp(prefix=prefix, suffix=suffix)
os.close(fd)
os.replace(local_filename, temp_filename)
move(local_filename, temp_filename)
local_filename = temp_filename
os.rmdir(temp_folder)
except Exception as ex:
Expand Down

0 comments on commit 1aff2a3

Please sign in to comment.