Skip to content

Help() crashes when given name not found #105702

Description

@terryjreedy

On Win 10 in 3.11.4, 3.12.0b1, and main compiled yesterday, there is a regression in that help() crashes.

help> xyz
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "F:\dev\3x\Lib\_sitebuiltins.py", line 103, in __call__
    return pydoc.help(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\dev\3x\Lib\pydoc.py", line 2009, in __call__
    self.interact()
  File "F:\dev\3x\Lib\pydoc.py", line 2036, in interact
    self.help(request)
  File "F:\dev\3x\Lib\pydoc.py", line 2062, in help
    elif request: doc(request, 'Help on %s:', output=self._output)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\dev\3x\Lib\pydoc.py", line 1786, in doc
    pager(render_doc(thing, title, forceload))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\dev\3x\Lib\pydoc.py", line 1760, in render_doc
    object, name = resolve(thing, forceload)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "F:\dev\3x\Lib\pydoc.py", line 1746, in resolve
    raise ImportError('''\
ImportError: No Python documentation found for 'xyz'.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.
>>>

In 3.10.11, 3.9.13, 3.8.10, there is no traceback. The exception is caught, the message printed, the short instructions printed, as above, and the help prompt given again.

help> xyz
No Python documentation found for 'xyz'.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.

help> 

This somehow messes up IDLE calltips, #105689, but I am treating that as a separate issue, though a diagnosis there as to whether the post-crash IDLE problem is in IDLE itself or somewhere else might give a hint here.

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    3.11only security fixes
    3.12only security fixes
    3.13only security fixes
    on Jun 12, 2023
  2. Eclips4 commented on Jun 12, 2023

    @Eclips4
    Member

    Duplicate of #102541
    We have a PR to solve this issue =)

  3. terryjreedy commented on Jun 12, 2023

    @terryjreedy
    MemberAuthor

    Thanks, I should have checked, or remember commenting there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixes3.12only security fixes3.13only security fixesrelease-blockertype-bugAn unexpected behavior, bug, or error

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions