You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BUG: [py3.11] AttributeError: 'PathDistribution' object has no attribute '_normalized_name' #98706
This shows up while trying to run the numpy test suite with python 3.11 and the newest pytest etc.
==================================== ERRORS ====================================
________________________ ERROR collecting test session _________________________
[...]
=========================== short test summary info ============================
ERROR - AttributeError: 'PathDistribution' object has no attribute '_normalized_name'
ERROR - AttributeError: 'PathDistribution' object has no attribute '_normalized_name'
2 errors in 1.41s
More precisely, the error appears in the vendored import_lib module
[...]/lib/python3.11/importlib/metadata/__init__.py:472: in load
ordered = sorted(eps, key=by_group)
by_group = operator.attrgetter('group')
cls = <class 'importlib.metadata.SelectableGroups'>
eps = <itertools.chain object at 0x7f19804ea5f0>
[...]/lib/python3.11/importlib/metadata/__init__.py:1013: in <genexpr>
eps = itertools.chain.from_iterable(
.0 = <generator object unique_everseen at 0x7f19805e9d40>
[...]/lib/python3.11/importlib/metadata/_itertools.py:16: in unique_everseen
k = key(element)
E AttributeError: 'PathDistribution' object has no attribute '_normalized_name'
element = <importlib_metadata.PathDistribution object at 0x7f19802c0450>
iterable = <itertools.chain object at 0x7f19804eae00>
key = operator.attrgetter('_normalized_name')
seen = set()
seen_add = <built-in method add of set object at 0x7f198035b060>
It looks like applying python/importlib_metadata@3e52430 should do the trick. Because #97785 is already in main, the changes will need to be applied to the 3.11 branch directly.
I note that 4.12.0 also includes changes that I'd previously not backported to Python 3.11 (#94270). @pablogsal Are you okay with changes from importlib_metadata 4.11.4-4.13.0 being applied as a bugfix for Python 3.11?
Activity
h-vetinari commentedon Oct 26, 2022
In the meantime, a work-around is to install
importlib_metadata >=4.13.jaraco commentedon Oct 30, 2022
It looks like applying python/importlib_metadata@3e52430 should do the trick. Because #97785 is already in main, the changes will need to be applied to the 3.11 branch directly.
jaraco commentedon Oct 30, 2022
I note that 4.12.0 also includes changes that I'd previously not backported to Python 3.11 (#94270). @pablogsal Are you okay with changes from importlib_metadata 4.11.4-4.13.0 being applied as a bugfix for Python 3.11?
jaraco commentedon Oct 30, 2022
I've applied the changes to the 3.11 branch with:
[3.11] pythongh-98706: Sync with importlib_metadata 4.13.0.
[3.11] gh-98706: Sync with importlib_metadata 4.13.0. (GH-98875)