You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the folder tree contains a symlink loop, dirhash recurses indefinitely and raises: OSError: [Errno 62] Too many levels of symbolic links: '<…>/test/fixtures/e/symlink'
Steps to Reproduce
Point to a directory that includes a symlink cycle. For example: (attaching here for reproducibility - tar-fs_2.1.1-sp1_CVE-2024-12905.zip)
Expected Behavior
should handle symlink loops gracefully—by skipping symlinks entirely based on the parameters of the function call.
Stack trace
File ".../create_dataset_from_metadata.py", line 73, in _deduplicate_folders
folder_hash = compute_sha256_of_folder(folder_path)
File ".../utils.py", line 34, in compute_sha256_of_folder
dirhash_result = dirhash(
File ".../.venv/lib/python3.12/site-packages/dirhash/init.py", line 153, in dirhash
return dirhash_impl(...)
File ".../scantree/_scan.py", line 303, in _scantree_recursive
dir_node = _scantree_recursive(subpath, **fwd_kwargs)
File ".../scantree/_filter.py", line 44, in include
if recursion_path.is_dir() and not self.linked_dirs:
File ".../scantree/_path.py", line 81, in is_dir
return self._dir_entry.is_dir(follow_symlinks=follow_symlinks)
OSError: [Errno 62] Too many levels of symbolic links: '…/test/fixtures/e/symlink'
Activity