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
sanitize_label crashes when node source_file is None (export.py:392) #454
graphify/export.py:392 calls sanitize_label(data.get("source_file", "")). When a node's source_file attribute is explicitly set to None (rather than the key being absent), dict.get returns None and sanitize_label raises TypeError: expected string or bytes-like object, got NoneType.
This happens in practice with concept nodes lifted from code AST — they carry an explicit source_file=None rather than omitting the key.
Repro
graphify <any code repo> --directed
Fails during the vis-network HTML build step.
Stack shape
File ".../graphify/export.py", line 392, in <listcomp>
"source_file": sanitize_label(data.get("source_file", "")),
File ".../graphify/security.py", line ...
TypeError: expected string or bytes-like object, got NoneType
One-line fix
Swap the dict.get default for an or "" fallback so both the missing-key and explicit-None cases are handled:
Same pattern applies at export.py:548 and export.py:642 where data.get("source_file", "") is used — they don't currently crash because the result is only string-concatenated, but will surface as "None" in output.
Local workaround
Currently patched client-side via a SKILL.md override in my Claude Code harness (walks G.nodes and rewrites None source_file/label/file_type to empty strings before calling to_html).
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…