python / importlib_metadata

Library to access metadata for Python packages
https://importlib-metadata.readthedocs.io
Apache License 2.0
128 stars 82 forks source link

AttributeError: 'PathDistribution' object has no attribute '_normalized_name' #396

Closed jaraco closed 2 years ago

jaraco commented 2 years ago

When importlib_metadata introduced the name normalization in PathDistributions starting in v4.3, it introduced a subtle incompatibility in select environments.

In particular, if a provider uses an older importlib metadata (importlib_metadata < 4.3 or importlib.metadata on Python < 3.10), and in that provider they supply PathDistributions, calls to resolve entry points will fail when any distribution doesn't have a _normalized_name attribute.

This issue was reported in several issues including:

Perhaps importlib_metadata should provide a compatibility shim to honor name normalization in distributions not supplying it (or at least not crash).

jaraco commented 2 years ago

Fixed in #397 and scheduled for release in 4.13.0.