transformers
dc9f8b4a - fix(fetcher): case-sensitive submodule check on case-insensitive filesystems

Commit
4 days ago
fix(fetcher): case-sensitive submodule check on case-insensitive filesystems When resolving `from .pkg import X`, the fetcher checks if `pkg/X.py` exists to determine whether `X` is a submodule or a symbol defined in `__init__.py`. On case-insensitive filesystems (Windows), `is_file()` matches regardless of casing, so a constant like `SLIDING_ATTENTION` incorrectly matches `sliding_attention.py` on disk, producing a dep entry with wrong casing that later causes a KeyError crash in the transitive closure loop. Fix: after `is_file()` returns True, compare `resolve().name` (actual disk filename) against the constructed name. Only treat it as a submodule if the names match exactly, preserving case-sensitive behavior on all platforms. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
Parents
Loading