Skip to content

pip debug causes AttributeError in Python 3.13 #12590

@eggplants

Description

@eggplants

Description

When running pip debug in Python 3.13.0a5, it raises AttributeError.

It seems that this error was caused by removal of importlib.resources.open_text in 3.13.

Expected behavior

pip debug doesn't raise AttributeError: module 'importlib.resources' has no attribute 'open_text'

pip version

24.0

Python version

Python 3.13.0a5

OS

Ubuntu 23.10

How to Reproduce

  1. pyenv install 3.13.0a5 && pyenv global 3.13.0a5
  2. pip debug

Output

$ pip debug
WARNING: This command is only meant for debugging. Do not use this with automation for parsin
g and getting these details, since the output and options of this command may change without
notice.
pip version: pip 24.0 from /home/eggplants/.pyenv/versions/3.13.0a5/lib/python3.13/site-packa
ges/pip (python 3.13)
sys.version: 3.13.0a5 (main, Mar 18 2024, 23:49:36) [GCC 13.2.0]
sys.executable: /home/eggplants/.pyenv/versions/3.13.0a5/bin/python3.13
sys.getdefaultencoding: utf-8
sys.getfilesystemencoding: utf-8
locale.getpreferredencoding: UTF-8
sys.platform: linux
sys.implementation:
  name: cpython
'cert' config value: Not specified
REQUESTS_CA_BUNDLE: None
CURL_CA_BUNDLE: None
pip._vendor.certifi.where(): /home/eggplants/.pyenv/versions/3.13.0a5/lib/python3.13/site-pac
kages/pip/_vendor/certifi/cacert.pem
pip._vendor.DEBUNDLED: False
vendored library versions:
ERROR: Exception:
Traceback (most recent call last):
  File "/home/eggplants/.pyenv/versions/3.13.0a5/lib/python3.13/site-packages/pip/_internal/c
li/base_command.py", line 180, in exc_logging_wrapper
    status = run_func(*args)
             ~~~~~~~~^^^^^^^
  File "/home/eggplants/.pyenv/versions/3.13.0a5/lib/python3.13/site-packages/pip/_internal/c
ommands/debug.py", line 197, in run
    show_vendor_versions()
    ~~~~~~~~~~~~~~~~~~~~^^
  File "/home/eggplants/.pyenv/versions/3.13.0a5/lib/python3.13/site-packages/pip/_internal/c
ommands/debug.py", line 106, in show_vendor_versions
    vendor_txt_versions = create_vendor_txt_map()
                          ~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/eggplants/.pyenv/versions/3.13.0a5/lib/python3.13/site-packages/pip/_internal/c
ommands/debug.py", line 38, in create_vendor_txt_map
    with importlib.resources.open_text("pip._vendor", "vendor.txt") as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'importlib.resources' has no attribute 'open_text'

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    S: needs triageIssues/PRs that need to be triagedtype: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions