diff --git a/src/fromager/sources.py b/src/fromager/sources.py index 6e3c11c9..54f31bbe 100644 --- a/src/fromager/sources.py +++ b/src/fromager/sources.py @@ -865,6 +865,10 @@ def scan_compiled_extensions( logger.debug("file %s has a binary extension suffix", relpath) issues.append(relpath) elif suffix not in ignore_suffixes: + # Path.walk() lists symlinks to directories as filenames + # rather than dirnames, causing IsADirectoryError on open(). + if not filepath.is_file(): + continue with filepath.open("rb") as f: header = f.read(_MAGIC_HEADERS_READ) if header.startswith(magic_headers):