Closed
Description
Currently, help
will show a traceback when we type name of something which doesn't exist:
help> 123
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<frozen _sitebuiltins>", line 103, in __call__
File "C:\Users\KIRILL-1\CLionProjects\cpython\Lib\pydoc.py", line 2004, in __call__
self.interact()
File "C:\Users\KIRILL-1\CLionProjects\cpython\Lib\pydoc.py", line 2031, in interact
self.help(request)
File "C:\Users\KIRILL-1\CLionProjects\cpython\Lib\pydoc.py", line 2057, in help
elif request: doc(request, 'Help on %s:', output=self._output)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\KIRILL-1\CLionProjects\cpython\Lib\pydoc.py", line 1781, in doc
pager(render_doc(thing, title, forceload))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\KIRILL-1\CLionProjects\cpython\Lib\pydoc.py", line 1755, in render_doc
object, name = resolve(thing, forceload)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\KIRILL-1\CLionProjects\cpython\Lib\pydoc.py", line 1741, in resolve
raise ImportError('''\
ImportError: No Python documentation found for '123'.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.
>>>
I think, this shouldn't be shown.
Is there any reason for this?
Can we show something like
No python documentation found for '123'.
?
Reproducible on current main.
Linked PRs
- gh-102541: Hide traceback in help prompt #102614
- [3.12] gh-102541: Hide traceback in help prompt (gh-102614) #105778
- [3.11] gh-102541: Hide traceback in help prompt (gh-102614). #105830
- gh-102541: Fix Helper.help("mod") for non-existent mod #105934
- [3.12] gh-102541: Fix Helper.help("mod") for non-existent mod (GH-105934) #106322
- [3.11] gh-102541: Fix Helper.help("mod") for non-existent mod (GH-105934) #106323
- gh-102541: Add test case for help() for non_existent_module #106340
- [3.12] gh-102541: Add test case for help() for non_existent_module (GH-106340) #106639
- [3.11] gh-102541: Add test case for help() for non_existent_module (GH-106340) #106640
Metadata
Metadata
Assignees
Labels
Projects
Status
Done