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
Some Sphinx inventories (see below) fail parsing with the following traceback:
Traceback
Traceback (most recent call last):
File "C:\Users\lmichaelis\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\lmichaelis\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\lmichaelis\xxx\.venv\Scripts\mkdocs.exe\__main__.py", line 7, in <module>
File "c:\users\lmichaelis\xxx\.venv\lib\site-packages\click\core.py", line 1126, in __call__
return self.main(*args, **kwargs)
File "c:\users\lmichaelis\xxx\.venv\lib\site-packages\click\core.py", line 1051, in main
rv = self.invoke(ctx)
File "c:\users\lmichaelis\xxx\.venv\lib\site-packages\click\core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\users\lmichaelis\xxx\.venv\lib\site-packages\click\core.py", line 1393, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\users\lmichaelis\xxx\.venv\lib\site-packages\click\core.py", line 752, in invoke
return __callback(*args, **kwargs)
File "c:\users\lmichaelis\xxx\.venv\lib\site-packages\mkdocs\__main__.py", line 250, in build_command
build.build(cfg, dirty=not clean)
File "c:\users\lmichaelis\xxx\.venv\lib\site-packages\mkdocs\commands\build.py", line 311, in build
env = config.plugins.run_event('env', env, config=config, files=files)
File "c:\users\lmichaelis\xxx\.venv\lib\site-packages\mkdocs\plugins.py", line 520, in run_event
result = method(item, **kwargs)
File "c:\users\lmichaelis\xxx\.venv\lib\site-packages\mkdocstrings\plugin.py", line 242, in on_env
for page, identifier in collections.ChainMap(*(fut.result() for fut in self._inv_futures)).items():
for page, identifier in collections.ChainMap(*(fut.result() for fut in self._inv_futures)).items():
File "C:\Users\lmichaelis\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\_base.py", line 439, in result
File "C:\Users\lmichaelis\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\_base.py", line 391, in __get_result
raise self._exception
File "C:\Users\lmichaelis\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "c:\users\lmichaelis\xxx\.venv\lib\site-packages\mkdocstrings\plugin.py", line 299, in _load_inventory
result = dict(loader(content, url=url, **kwargs))
File "c:\users\lmichaelis\xxx\.venv\lib\site-packages\mkdocstrings_handlers\python\handler.py", line 189, in load_inventory
for item in Inventory.parse_sphinx(in_file, domain_filter=("py",)).values(): # noqa: WPS526
File "c:\users\lmichaelis\xxx\.venv\lib\site-packages\mkdocstrings\inventory.py", line 129, in parse_sphinx
items = [InventoryItem.parse_sphinx(line.decode("utf8")) for line in lines]
File "c:\users\lmichaelis\xxx\.venv\lib\site-packages\mkdocstrings\inventory.py", line 129, in <listcomp>
items = [InventoryItem.parse_sphinx(line.decode("utf8")) for line in lines]
File "c:\users\lmichaelis\xxx\.venv\lib\site-packages\mkdocstrings\inventory.py", line 56, in parse_sphinx
raise ValueError(line)
ValueError: index std:doc -1 Werkzeug
Even though I encountered this error using the new Python handler this error occurs in mkdocstrings as the traceback shows.
To Reproduce
Steps to reproduce the behavior:
Set up a basic mkdocstrings configuration
Add any of the following inventories as an import to the Python handler
Some Sphinx inventories don't match
the `sphinx_item_regex` defined in `InventoryItem`.
Allowing any number of whitespace characters at the end
instead of requiring at least one fixes this issue.
Co-authored-by: Luis Michaelis <luis.michaelis@iee.fraunhofer.de>
Issue #496: #496
PR #497: #497
Describe the bug
Some Sphinx inventories (see below) fail parsing with the following traceback:
Traceback
Even though I encountered this error using the new Python handler this error occurs in
mkdocstrings
as the traceback shows.To Reproduce
Steps to reproduce the behavior:
mkdocs build
ormkdocs serve
My Configuration
Expected behavior
The inventory is downloaded, parsed and used to link to external documentation.
Information (please complete the following information):
mkdocstrings
version: 0.19.0Additional context
I have narrowed it down to the regex used in
inventory.py
:mkdocstrings/src/mkdocstrings/inventory.py
Line 49 in efa00b2
It is used to validate one line of the inventory in
parse_sphinx()
where it fails to match the line:mkdocstrings/src/mkdocstrings/inventory.py
Lines 51 to 62 in efa00b2
Altering one character of the regex seems to fix it though I am not sure of any other effects it might have:
The text was updated successfully, but these errors were encountered: