diff --git a/clearml_agent/helper/os/folder_cache.py b/clearml_agent/helper/os/folder_cache.py index f0e6a39..16bdadc 100644 --- a/clearml_agent/helper/os/folder_cache.py +++ b/clearml_agent/helper/os/folder_cache.py @@ -152,7 +152,14 @@ class FolderCache(object): for f in source_folder.glob('*'): if f.name in exclude_sub_folders: 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 target_cache_folder = self._cache_folder / '.'.join(keys)