Skip to content

The pydoc3 command uses the incorrect interpreter in virtual environments and fails to bring documentation for installed packages. #109115

Closed as not planned
@CarvellScott

Description

@CarvellScott

Bug report

Bug description:

Problem: On python 3.10, /usr/bin/pydoc3 uses a shebang line of #!/usr/bin/python3.10. Because this doesn't get symlinked or copied into a virtual environment on creation (at least when done through python3 -m venv), it uses a different version of python and correspondingly different set of modules when presenting documentation.

Reproduction Instructions:

python3 -m venv venv
source venv/bin/activate
echo '"This module is documented"' > venv/lib/python3.13/site-packages/documented_module.py
pydoc3 documented_module

Expected Result: Documentation for "documented_module" shows up.
Actual Result: A message saying "No Python documentation found for 'documented_module'" shows instead.

CPython versions tested on:

3.10, CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions