GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Python3.11: invalid help query raises an ImportError · Issue #98374 · python/cpython

Python3.11: invalid help query raises an ImportError #98374

New issue
Copy link
New issue
Copy link
Closed
Closed
Python3.11: invalid help query raises an ImportError#98374
Copy link
Labels
3.11only security fixesonly security fixes3.12only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@qexat
qexat
opened on Oct 18, 2022
Issue body actions

Bug report

Running this on Python 3.11 REPL:

>>> help("invalid query")

Raises the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen _sitebuiltins>", line 103, in __call__
  File "/usr/lib/python3.11/pydoc.py", line 2001, in __call__
    self.help(request)
  File "/usr/lib/python3.11/pydoc.py", line 2057, in help
    elif request: doc(request, 'Help on %s:', output=self._output)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/pydoc.py", line 1784, in doc
    pager(render_doc(thing, title, forceload))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/pydoc.py", line 1758, in render_doc
    object, name = resolve(thing, forceload)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/pydoc.py", line 1744, in resolve
    raise ImportError('''\
ImportError: No Python documentation found for 'invalid query'.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.

Python 3.10.8 (and most probably any 3.10.*) simply prints this:

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

Your environment

  • CPython versions tested on: 3.11.0, 3.10.8
  • Operating system and architecture: EndeavourOS, kernel: 6.0.1-arch2-1 (64-bit)

Apparently, this is due to commit 8868d48712aee2b490efaf60bed8dfe9fb14d6b7 (thanks to @asottile for finding it).

Is it expected behavior though?

Activity

  1. qexat
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Oct 18, 2022
  2. iritkatriel commented on Oct 18, 2022

    @iritkatriel
    iritkatriel
    on Oct 18, 2022
    Member
    More actions

    Possibly due to #27868.

  3. iritkatriel
    added
    3.11only security fixesonly security fixes
    3.12only security fixesonly security fixes
    needs backport to 3.11only security fixesonly security fixes
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on Oct 18, 2022
  4. qexat commented on Oct 18, 2022

    @qexat
    qexat
    on Oct 18, 2022
    Author
    More actions

    Possibly due to #27868.

    Indeed, the commit I mention was present in this PR.

  5. corona10
    added 6 commits that reference this issue on Oct 19, 2022

    pythongh-98374: Suppress ImportError for invalid query for help() com…

    b2e4188

    pythongh-98374: Suppress ImportError for invalid query for help() com…

    1b03435

    pythongh-98374: Suppress ImportError for invalid query for help() com…

    a4d5b80

    gh-98374: Suppress ImportError for invalid query for help() command. (g…

    4156b2f

    [3.11] pythongh-98374: Suppress ImportError for invalid query for hel…

    697e1fc

    [3.11] gh-98374: Suppress ImportError for invalid query for help() co… (

    e2af980
  6. corona10
    closed this as completedon Oct 20, 2022
  7. corona10
    removed
    needs backport to 3.11only security fixesonly security fixes
    on Oct 20, 2022
  8. carljm
    added a commit that references this issue on Oct 20, 2022

    Merge branch 'main' into typewatch

    8bba5da
  9. terryjreedy commented on Jun 12, 2023

    @terryjreedy
    terryjreedy
    on Jun 12, 2023
    Member
    More actions

    (EDIT) This fix did not catch all cases. See #102541 for help()...help> invalid giving a traceback ending in the same place with the same result.

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 fixesonly security fixes3.12only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.