-
-
Notifications
You must be signed in to change notification settings - Fork 123
bug: when force_inspection: true crashes with AttributeError: 'NoneType' object has no attribute 'kind' #753
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
griffe extensionCan be solved with a Griffe extensionCan be solved with a Griffe extension
Description
Description of the bug
When I run mkdocs serve with force_inspection: true I get
[snip]
if parent.kind is Kind.MODULE:
^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'kind'
To Reproduce
git clone https://github.com/k4lizen/pwndbg
cd pwndbg
git checkout mkdocstrings-crash
uv run --group docs mkdocs serve
Full traceback
Full traceback
[snip...]
INFO - api-autonav: Documenting 'pwndbg.rizin' in virtual file: reference/pwndbg/rizin.md
INFO - api-autonav: Documenting 'pwndbg.search' in virtual file: reference/pwndbg/search.md
INFO - api-autonav: Documenting 'pwndbg.ui' in virtual file: reference/pwndbg/ui.md
INFO - api-autonav: Documenting 'pwndbg.wrappers' in virtual file: reference/pwndbg/wrappers/index.md
INFO - api-autonav: Documenting 'pwndbg.wrappers.checksec' in virtual file: reference/pwndbg/wrappers/checksec.md
INFO - api-autonav: Documenting 'pwndbg.wrappers.readelf' in virtual file: reference/pwndbg/wrappers/readelf.md
WARNING - Doc file 'misc/binja_integration.md' contains a link '../binja_script.py', but the target 'binja_script.py'
is not found among documentation files.
ERROR - Error reading page 'reference/pwndbg/index.md': 'NoneType' object has no attribute 'kind'
Traceback (most recent call last):
File "/home/path/pwndbg/.venv/bin/mkdocs", line 10, in <module>
sys.exit(cli())
~~~^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/click/core.py", line 1161, in __call__
return self.main(*args, **kwargs)
~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/mkdocs/__main__.py", line 272, in serve_command
serve.serve(**kwargs)
~~~~~~~~~~~^^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/mkdocs/commands/serve.py", line 85, in serve
builder(config)
~~~~~~~^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/mkdocs/commands/serve.py", line 67, in builder
build(config, serve_url=None if is_clean else serve_url, dirty=is_dirty)
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/mkdocs/commands/build.py", line 310, in build
_populate_page(file.page, config, files, dirty)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/mkdocs/commands/build.py", line 167, in _populate_page
page.render(config, files)
~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/mkdocs/structure/pages.py", line 285, in render
self.content = md.convert(self.markdown)
~~~~~~~~~~^^^^^^^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/markdown/core.py", line 357, in convert
root = self.parser.parseDocument(self.lines).getroot()
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/markdown/blockparser.py", line 117, in parseDocument
self.parseChunk(self.root, '\n'.join(lines))
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/markdown/blockparser.py", line 136, in parseChunk
self.parseBlocks(parent, text.split('\n\n'))
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/markdown/blockparser.py", line 158, in parseBlocks
if processor.run(parent, blocks) is not False:
~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/mkdocstrings/_internal/extension.py", line 126, in run
html, handler, data = self._process_block(identifier, block, heading_level)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/mkdocstrings/_internal/extension.py", line 189, in _process_block
data: CollectorItem = handler.collect(identifier, options)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/mkdocstrings_handlers/python/_internal/handler.py", line 251, in collect
loader.load(
~~~~~~~~~~~^
module_name,
^^^^^^^^^^^^
try_relative_path=False,
^^^^^^^^^^^^^^^^^^^^^^^^
find_stubs_package=options.find_stubs_package,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/_griffe/loader.py", line 179, in load
top_module = self._load_package(package, submodules=submodules)
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/_griffe/loader.py", line 508, in _load_package
top_module = self._load_module(package.name, package.path, submodules=submodules)
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/_griffe/loader.py", line 531, in _load_module
return self._load_module_path(module_name, module_path, submodules=submodules, parent=parent)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/_griffe/loader.py", line 563, in _load_module_path
self._load_submodules(module)
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/_griffe/loader.py", line 568, in _load_submodules
self._load_submodule(module, subparts, subpath)
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/_griffe/loader.py", line 601, in _load_submodule
submodule = self._load_module(
submodule_name,
...<2 lines>...
parent=parent_module,
)
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/_griffe/loader.py", line 531, in _load_module
return self._load_module_path(module_name, module_path, submodules=submodules, parent=parent)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/_griffe/loader.py", line 553, in _load_module_path
module = self._inspect_module(module_name, module_path, parent)
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/_griffe/loader.py", line 657, in _inspect_module
module = inspect(
module_name,
...<7 lines>...
modules_collection=self.modules_collection,
)
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/_griffe/agents/inspector.py", line 92, in inspect
).get_module(import_paths)
~~~~~~~~~~^^^^^^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/_griffe/agents/inspector.py", line 230, in get_module
self.inspect(module_node)
~~~~~~~~~~~~^^^^^^^^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/_griffe/agents/inspector.py", line 239, in inspect
getattr(self, f"inspect_{node.kind}", self.generic_inspect)(node)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/_griffe/agents/inspector.py", line 484, in inspect_attribute
self.handle_attribute(node)
~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/home/path/pwndbg/.venv/lib/python3.13/site-packages/_griffe/agents/inspector.py", line 500, in handle_attribute
if parent.kind is Kind.MODULE:
^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'kind'Expected behavior
The thingy builds without erroring out.
Environment information
~> uv run --group docs python -m mkdocstrings._internal.debug
- __System__: Linux-6.13.7-artix1-1-x86_64-with-glibc2.41
- __Python__: cpython 3.13.2 (/home/path/pwndbg/.venv/bin/python3)
- __Environment variables__:
- __Installed packages__:
- `mkdocstrings` v0.29.1
~>Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
griffe extensionCan be solved with a Griffe extensionCan be solved with a Griffe extension