From 89efea9547ebf47fe1d35d797be1b3c1f25b4762 Mon Sep 17 00:00:00 2001 From: Mike DePaulo Date: Tue, 31 Mar 2026 16:54:45 -0400 Subject: [PATCH] fix(sources): skip non-regular files in scan_compiled_extensions pathlib.Path.walk() lists symlinks to directories as filenames rather than dirnames. This causes scan_compiled_extensions to attempt to open() them, resulting in IsADirectoryError. Add an is_file() check to skip non-regular files before attempting to read their contents. Closes: #1001 Signed-off-by: Mike DePaulo Co-Authored-By: Claude Opus 4.6 --- src/fromager/sources.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fromager/sources.py b/src/fromager/sources.py index 6e3c11c9..94624738 100644 --- a/src/fromager/sources.py +++ b/src/fromager/sources.py @@ -859,6 +859,8 @@ def scan_compiled_extensions( for directory, _, filenames in root_dir.walk(): for filename in filenames: filepath = directory / filename + if not filepath.is_file(): + continue suffix = filepath.suffix if suffix in extension_suffixes: relpath = filepath.relative_to(root_dir)