mirror of
https://github.com/clearml/clearml-agent
synced 2025-06-26 18:16:15 +00:00
Fix venv cache crash on bad symbolic links
This commit is contained in:
@@ -152,7 +152,14 @@ class FolderCache(object):
|
|||||||
for f in source_folder.glob('*'):
|
for f in source_folder.glob('*'):
|
||||||
if f.name in exclude_sub_folders:
|
if f.name in exclude_sub_folders:
|
||||||
continue
|
continue
|
||||||
shutil.copytree(src=f.as_posix(), dst=(temp_folder / f.name).as_posix(), symlinks=True)
|
if f.is_dir():
|
||||||
|
shutil.copytree(
|
||||||
|
src=f.as_posix(), dst=(temp_folder / f.name).as_posix(),
|
||||||
|
symlinks=True, ignore_dangling_symlinks=True)
|
||||||
|
else:
|
||||||
|
shutil.copy(
|
||||||
|
src=f.as_posix(), dst=(temp_folder / f.name).as_posix(),
|
||||||
|
follow_symlinks=False)
|
||||||
|
|
||||||
# rename the target folder
|
# rename the target folder
|
||||||
target_cache_folder = self._cache_folder / '.'.join(keys)
|
target_cache_folder = self._cache_folder / '.'.join(keys)
|
||||||
|
|||||||
Reference in New Issue
Block a user