Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip list fails on Python 3.12a5 on Windows with AttributeError #11844

Closed
1 task done
icemac opened this issue Mar 7, 2023 · 1 comment
Closed
1 task done

pip list fails on Python 3.12a5 on Windows with AttributeError #11844

icemac opened this issue Mar 7, 2023 · 1 comment
Labels
resolution: duplicate Duplicate of an existing issue/PR

Comments

@icemac
Copy link

icemac commented Mar 7, 2023

Description

I am running pip list and get a because of an AttributeError.

Using:

  • Python 3.12a5
  • on GitHub Actions
  • on a Microsoft Windows Server 2022 OS
  • in the RestrictedPython project

It only occurs on Windows, only for Python 3.12 (Ubuntu and other Python versions are fine.)

Expected behavior

Rendering of the list of installed packages.

pip version

23.0.1

Python version

3.12a5

OS

Microsoft Windows Server 2022

How to Reproduce

I have no access to a locally installed Windows machine, so I am unable reproduce the error locally.

In GHA I do the following:

  1. git clone https://github.com/zopefoundation/RestrictedPython.git
  2. python -m pip install --upgrade pip
  3. pip install tox
  4. tox -e py312
  5. pip list is than called by tox via tox.ini.

Output

py312: commands[1]> pip list
ERROR: Exception:
Traceback (most recent call last):
  File "D:\a\RestrictedPython\RestrictedPython\.tox\py312\Lib\site-packages\pip\_internal\cli\base_command.py", line 160, in exc_logging_wrapper
    status = run_func(*args)
             ^^^^^^^^^^^^^^^
  File "D:\a\RestrictedPython\RestrictedPython\.tox\py312\Lib\site-packages\pip\_internal\commands\list.py", line 169, in run
    packages: "_ProcessedDists" = [
                                  ^
  File "D:\a\RestrictedPython\RestrictedPython\.tox\py312\Lib\site-packages\pip\_internal\commands\list.py", line 169, in <listcomp>
    packages: "_ProcessedDists" = [
                                  ^
  File "D:\a\RestrictedPython\RestrictedPython\.tox\py312\Lib\site-packages\pip\_internal\metadata\base.py", line 664, in <genexpr>
    return (d for d in it if d.canonical_name not in skip)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\a\RestrictedPython\RestrictedPython\.tox\py312\Lib\site-packages\pip\_internal\metadata\base.py", line 612, in iter_all_distributions
    for dist in self._iter_distributions():
  File "D:\a\RestrictedPython\RestrictedPython\.tox\py312\Lib\site-packages\pip\_internal\metadata\importlib\_envs.py", line 176, in _iter_distributions
    for dist in finder.find_eggs(location):
  File "D:\a\RestrictedPython\RestrictedPython\.tox\py312\Lib\site-packages\pip\_internal\metadata\importlib\_envs.py", line 146, in find_eggs
    yield from self._find_eggs_in_zip(location)
  File "D:\a\RestrictedPython\RestrictedPython\.tox\py312\Lib\site-packages\pip\_internal\metadata\importlib\_envs.py", line 123, in _find_eggs_in_zip
    from pip._vendor.pkg_resources import find_eggs_in_zip
  File "D:\a\RestrictedPython\RestrictedPython\.tox\py312\Lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3251, in <module>
    @_call_aside
     ^^^^^^^^^^^
  File "D:\a\RestrictedPython\RestrictedPython\.tox\py312\Lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3235, in _call_aside
    f(*args, **kwargs)
  File "D:\a\RestrictedPython\RestrictedPython\.tox\py312\Lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3277, in _initialize_master_working_set
    tuple(
  File "D:\a\RestrictedPython\RestrictedPython\.tox\py312\Lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 3278, in <genexpr>
    dist.activate(replace=False)
  File "D:\a\RestrictedPython\RestrictedPython\.tox\py312\Lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2785, in activate
    declare_namespace(pkg)
  File "D:\a\RestrictedPython\RestrictedPython\.tox\py312\Lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2284, in declare_namespace
    _handle_ns(packageName, path_item)
  File "D:\a\RestrictedPython\RestrictedPython\.tox\py312\Lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 2201, in _handle_ns
    loader = importer.find_module(packageName)
             ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'zipimporter' object has no attribute 'find_module'. Did you mean: 'load_module'?

Full GHA run, see https://github.com/zopefoundation/RestrictedPython/actions/runs/4351559170/jobs/7603343628

Code of Conduct

@icemac icemac added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Mar 7, 2023
@uranusjr
Copy link
Member

uranusjr commented Mar 7, 2023

Duplicate of #11501

@uranusjr uranusjr marked this as a duplicate of #11501 Mar 7, 2023
@uranusjr uranusjr closed this as not planned Won't fix, can't repro, duplicate, stale Mar 7, 2023
@uranusjr uranusjr added resolution: duplicate Duplicate of an existing issue/PR and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Mar 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: duplicate Duplicate of an existing issue/PR
Projects
None yet
Development

No branches or pull requests

2 participants