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
ERROR - mkdocstrings.handlers.python: Collection failed: ('No route with that name.', '__wrapped__')
Traceback (most recent call last):
File "/venv/lib/python3.8/site-packages/pytkdocs/cli.py", line 193, in main
output = json.dumps(process_json(line))
File "/venv/lib/python3.8/site-packages/pytkdocs/cli.py", line 114, in process_json
return process_config(json.loads(json_input))
File "/venv/lib/python3.8/site-packages/pytkdocs/cli.py", line 91, in process_config
obj = loader.get_object_documentation(path, members)
File "/venv/lib/python3.8/site-packages/pytkdocs/loader.py", line 230, in get_object_documentation
root_object = self.get_module_documentation(leaf, members)
File "/venv/lib/python3.8/site-packages/pytkdocs/loader.py", line 311, in get_module_documentation
root_object.add_child(self.get_module_documentation(leaf))
File "/venv/lib/python3.8/site-packages/pytkdocs/loader.py", line 295, in get_module_documentation
child_node = ObjectNode(member, member_name, parent=node)
File "/venv/lib/python3.8/site-packages/pytkdocs/loader.py", line 43, in __init__
self.obj: Any = inspect.unwrap(obj)
File "/usr/lib/python3.8/inspect.py", line 520, in unwrap
while _is_wrapper(func):
File "/usr/lib/python3.8/inspect.py", line 511, in _is_wrapper
return hasattr(f, '__wrapped__')
File "/venv/lib/python3.8/site-packages/beancount/web/bottle_utils.py", line 25, in __getattr__
return self.mapper_function(name)
File "/venv/bin/bottle.py", line 409, in build
if not builder: raise RouteBuildError("No route with that name.", _name)
bottle.RouteBuildError: ('No route with that name.', '__wrapped__')
ERROR - mkdocstrings.extension: Could not collect 'beancount.web'
ERROR - Error reading page 'api_reference/beancount.web.md': ('No route with that name.', '__wrapped__')
Traceback (most recent call last):
File "build.py", line 52, in <module>
sys.exit(cli())
File "/venv/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/venv/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/venv/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/venv/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/venv/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/venv/lib/python3.8/site-packages/mkdocs/__main__.py", line 140, in serve_command
serve.serve(
File "/venv/lib/python3.8/site-packages/mkdocs/commands/serve.py", line 141, in serve
config = builder()
File "/venv/lib/python3.8/site-packages/mkdocs/commands/serve.py", line 136, in builder
build(config, live_server=live_server, dirty=dirty)
File "/venv/lib/python3.8/site-packages/mkdocs/commands/build.py", line 274, in build
_populate_page(file.page, config, files, dirty)
File "/venv/lib/python3.8/site-packages/mkdocs/commands/build.py", line 174, in _populate_page
page.render(config, files)
File "/venv/lib/python3.8/site-packages/mkdocs/structure/pages.py", line 183, in render
self.content = md.convert(self.markdown)
File "/venv/lib/python3.8/site-packages/markdown/core.py", line 263, in convert
root = self.parser.parseDocument(self.lines).getroot()
File "/venv/lib/python3.8/site-packages/markdown/blockparser.py", line 90, in parseDocument
self.parseChunk(self.root, '\n'.join(lines))
File "/venv/lib/python3.8/site-packages/markdown/blockparser.py", line 105, in parseChunk
self.parseBlocks(parent, text.split('\n\n'))
File "/venv/lib/python3.8/site-packages/markdown/blockparser.py", line 123, in parseBlocks
if processor.run(parent, blocks) is not False:
File "/venv/lib/python3.8/site-packages/mkdocstrings/extension.py", line 147, in run
data: Any = handler.collector.collect(identifier, selection)
File "/venv/lib/python3.8/site-packages/mkdocstrings/handlers/python.py", line 204, in collect
raise CollectionError(result["error"])
mkdocstrings.handlers.CollectionError: ('No route with that name.', '__wrapped__')
I'm always amazed by the flexibility of Python. inspect.unwrap calls hasattr on the object, triggering its __getattr__ method which in turn calls a mapper function that was passed to it, and defined in the bottle script I guess.
Well, I guess the obvious fix is to catch every exception when unwrapping:
Describe the bug
I upgraded to pytkdocs 0.5.1 and got this error:
Here's the relevant source code:
https://github.com/beancount/beancount/blob/2.3.0/beancount/web/bottle_utils.py#L24-L25
System (please complete the following information):
pytkdocs
version: 0.5.1The text was updated successfully, but these errors were encountered: