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
file_hash crashes with IsADirectoryError when source_file points to a directory (cache.py:27) #455
graphify/cache.py:27 inside file_hash() calls p.read_bytes(), which raises IsADirectoryError if p is a directory. This triggers during save_semantic_cache when a node's source_file attribute accidentally holds a directory path (e.g. module-level nodes in Python packages where the "source" is the package dir, not a specific .py).
IsADirectoryError: [Errno 21] Is a directory: '/some/package/dir'
Current code
deffile_hash(path: Path) ->str:
p=Path(path)
raw=p.read_bytes() # line 27 — blows up on directoriescontent=_body_content(raw) ifp.suffix.lower() ==".md"elseraw
...
One-line fix
Guard with is_file() before reading:
deffile_hash(path: Path) ->str:
p=Path(path)
ifnotp.is_file():
return""# skip sentinel; save_semantic_cache can filter out empty hashesraw=p.read_bytes()
...
Callers (e.g. save_semantic_cache) should treat the empty string as "skip, don't cache this entry" rather than hashing a non-file.
Local workaround
Client-side filter in the SKILL.md dispatch that drops nodes/edges/hyperedges where source_file isn't a regular file before calling save_semantic_cache — verified on a recent .claude/skills/ run (169 files cached with 0 drops when all source_files resolved to real files).
Companion issue: #454 (sanitize_label None crash in export.py) — same pattern of None/non-file source_file tripping downstream code.
Activity
fix Graphify-Labs#455 Graphify-Labs#448 IsADirectoryError in file_has…
fix #455 #448 IsADirectoryError in file_hash and save_semantic_cache, f…
fix Graphify-Labs#455 Graphify-Labs#448 IsADirectoryError in file_has…