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
Bug: 'cgc watch' incremental indexing failing with "AttributeError: 'NoneType' object has no attribute 'split'" #1272
Hi, team cgc! I'm using main branch commit c235df7 and when cgc watch is observing a repo for file changes, when changes are detected in multiple files, all threads are failing with errors similar to the following:
...
Exception in thread Thread-145:
Traceback (most recent call last):
File "/Users/peter.junkoh/.pyenv/versions/3.14.4/lib/python3.14/threading.py", line 1082, in _bootstrap_inner
self._context.run(self.run)
~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "/Users/peter.junkoh/.pyenv/versions/3.14.4/lib/python3.14/threading.py", line 1385, in run
self.function(*self.args, **self.kwargs)
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/peter.junkoh/Documents/repos/personal/CodeGraphContext/src/codegraphcontext/core/watcher.py", line 310, in <lambda>
self._debounce(event.src_path, lambda: self._handle_modification(event.src_path))
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
File "/Users/peter.junkoh/Documents/repos/personal/CodeGraphContext/src/codegraphcontext/core/watcher.py", line 264, in _handle_modification
self.graph_builder.link_inheritance(subset_file_data, self.imports_map)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/peter.junkoh/Documents/repos/personal/CodeGraphContext/src/codegraphcontext/tools/graph_builder.py", line 854, in link_inheritance
self._writer.write_decorated_by_links(build_decorated_by_links(all_file_data, imports_map))
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/peter.junkoh/Documents/repos/personal/CodeGraphContext/src/codegraphcontext/tools/indexing/resolution/inheritance.py", line 365, in build_decorated_by_links
dec_path = _resolve_decorator_path(
dec_name, caller_file_path, local_names, local_imports, imports_map
)
File "/Users/peter.junkoh/Documents/repos/personal/CodeGraphContext/src/codegraphcontext/tools/indexing/resolution/inheritance.py", line 323, in _resolve_decorator_path
lookup = imported.split(".")[-1]
^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'split'
Root cause: Several dict comprehensions that build local_imports call .split() or .endswith() on imp["name"] without checking for None. When tree-sitter parsers produce import entries with "name": None (e.g., certain relative/star/aliased import forms), this crashes with AttributeError.
Fix summary:
Added imp.get("name") guards to all affected dict comprehensions in graph_builder.py, inheritance.py, and calls.py
Guarded _resolve_decorator_path against None imported values with fall-through to imports_map lookup
Added full_import_name fallback for decorator/metaclass resolution (Python imports have full_import_name but not source)
The fix also covers the related issue #1285 (decorator path crash).
Activity
github-actions commentedon Jun 17, 2026
Hi! 👋 Join our CodeGraphContext Discord channel to collaborate: https://discord.gg/dR4QY32uYQ
Akshitha2912v commentedon Jun 17, 2026
Hi, I would like to work on this issue under GSSoC 2026. Please assign it to me.
Thank you!
MorningStar0709 commentedon Jun 20, 2026
Hi @PeterJunker, I've opened PR #1291 which addresses this issue.
Root cause: Several dict comprehensions that build
local_importscall.split()or.endswith()onimp["name"]without checking forNone. When tree-sitter parsers produce import entries with"name": None(e.g., certain relative/star/aliased import forms), this crashes withAttributeError.Fix summary:
imp.get("name")guards to all affected dict comprehensions ingraph_builder.py,inheritance.py, andcalls.py_resolve_decorator_pathagainstNoneimported values with fall-through toimports_maplookupfull_import_namefallback for decorator/metaclass resolution (Python imports havefull_import_namebut notsource)The fix also covers the related issue #1285 (decorator path crash).
Shashankss1205 commentedon Jul 25, 2026
Resolved: the watcher incremental-parse
NoneType.split()crash is fixed by import-name/source guards (commits 59d9172, 62dae1e). Closing.