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
{{ message }}
Repository navigation
Python extraction crashes on over-deep relative import resolving to filesystem root #2605
AST extraction failed: PosixPath("/") has an empty name
Exit code: 1.
A reduced fixture containing only the same 27-dot import fails identically. Python parses that import with level=27 and module=None.
A nearby level-1 relative-import control succeeds and produces a graph with 4 nodes and 2 edges.
Cause
The Python module resolver reaches Path("/") and calls candidate.with_suffix(".py") without guarding candidate.name. Path("/").with_suffix(".py") raises the observed ValueError.
Expected behavior
An over-deep relative import should be ignored or represented as unresolved without aborting extraction of the entire source tree.
Suggested narrow fix
Before calling with_suffix, return no candidate when candidate.name is empty. This avoids changing Graphify behavior for legitimate named out-of-root relative imports.
Validation requested
hostile 27-dot relative-import regression
ordinary relative-import passing control
existing out-of-root named import tests remain green
full Ruff code-only extraction completes and writes a graph
The reproduction ran in a disposable isolated environment with a 60-second wall limit, 30-second CPU limit, 2 GiB process-group RSS limit, and 10 MiB log limit.
Fixed in v0.9.40 (graphifyy==0.9.40 on PyPI). Resolving an over-deep relative import (from ....x import y above the package root) no longer crashes: an empty-name (filesystem-root) candidate is now guarded, so extraction degrades gracefully instead of raising. Thanks @SinghAman21 (PR #2611).
Activity
chore: bump to 0.9.40
safishamsi commentedon Aug 11, 2026
Fixed in v0.9.40 (
graphifyy==0.9.40on PyPI). Resolving an over-deep relative import (from ....x import yabove the package root) no longer crashes: an empty-name (filesystem-root) candidate is now guarded, so extraction degrades gracefully instead of raising. Thanks @SinghAman21 (PR #2611).