Skip to content

Bulk asynchronous downloader for multiple file hosts

fix: ignore errors while deleting partial files (#1571)

NTFSvolume17f6f7ccc6ee
diff --git a/cyberdrop_dl/utils/utilities.py b/cyberdrop_dl/utils/utilities.py
index c30e20942..385135370 100644
--- a/cyberdrop_dl/utils/utilities.py
+++ b/cyberdrop_dl/utils/utilities.py
@@ -316,17 +316,20 @@ def check_partials_and_empty_folders(manager: Manager) -> None:
def _partial_files(dir: Path | str) -> Generator[Path]:
- for entry in os.scandir(dir):
- try:
- if entry.is_dir(follow_symlinks=False):
- yield from _partial_files(entry.path)
- continue
- except OSError:
- pass
-
- suffix = entry.name.rpartition(".")[-1]
- if f".{suffix}" in constants.TempExt:
- yield Path(entry.path)
+ try:
+ for entry in os.scandir(dir):
+ try:
+ if entry.is_dir(follow_symlinks=False):
+ yield from _partial_files(entry.path)
+ continue
+ except OSError:
+ pass
+
+ suffix = entry.name.rpartition(".")[-1]
+ if f".{suffix}" in constants.TempExt:
+ yield Path(entry.path)
+ except OSError:
+ return
def delete_partial_files(manager: Manager) -> None: