From 37e0ca2bdb14549f6e4995be09af2d5c129777f5 Mon Sep 17 00:00:00 2001 From: Lucain Pouget Date: Wed, 31 Jul 2024 10:48:37 +0200 Subject: [PATCH] Fix shutil move --- src/huggingface_hub/file_download.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/huggingface_hub/file_download.py b/src/huggingface_hub/file_download.py index a37e74d6aa..58de35582c 100644 --- a/src/huggingface_hub/file_download.py +++ b/src/huggingface_hub/file_download.py @@ -940,7 +940,7 @@ def _create_symlink(src: str, dst: str, new_blob: bool = False) -> None: # Symlinks are not supported => let's move or copy the file. if new_blob: logger.info(f"Symlink not supported. Moving file from {abs_src} to {abs_dst}") - shutil.move(abs_src, abs_dst) + shutil.move(abs_src, abs_dst, copy_function=_copy_no_matter_what) else: logger.info(f"Symlink not supported. Copying file from {abs_src} to {abs_dst}") shutil.copyfile(abs_src, abs_dst)