◐ Shell
clean mode source ↗

gh-143387: Raise an exception instead of returning None when metadata file is missing. by jaraco · Pull Request #146234 · python/cpython

…ssing.

Syncs changes from importlib_metadata 9.0

@jaraco

@jaraco jaraco changed the title Raise an exception instead of returning None when metadata file is missing. gh-143387: Raise an exception instead of returning None when metadata file is missing.

Mar 20, 2026

CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull request

Mar 23, 2026

hroncok added a commit to hroncok/rpmlint-1 that referenced this pull request

Apr 2, 2026
Python 3.15's importlib.metadata now strictly requires PKG-INFO files
in egg-info directories when accessing the requires property. Without it,
self.metadata is None and triggers AttributeError when reading d.requires.
Although reported as a regression, upstream chose to enforce this requirement
rather than handle missing metadata gracefully.

python/cpython#143387

In near future, it will raise MetadataNotFound(FileNotFoundError).

python/cpython#146234

Conan-Kudo pushed a commit to rpm-software-management/rpmlint that referenced this pull request

Apr 2, 2026
Python 3.15's importlib.metadata now strictly requires PKG-INFO files
in egg-info directories when accessing the requires property. Without it,
self.metadata is None and triggers AttributeError when reading d.requires.
Although reported as a regression, upstream chose to enforce this requirement
rather than handle missing metadata gracefully.

python/cpython#143387

In near future, it will raise MetadataNotFound(FileNotFoundError).

python/cpython#146234

@KRRT7 KRRT7 mentioned this pull request

Apr 9, 2026

2 tasks

ljfp pushed a commit to ljfp/cpython that referenced this pull request

Apr 25, 2026

frenzymadness added a commit to frenzymadness/poetry that referenced this pull request

Apr 27, 2026
In Python 3.15, importlib.metadata raises MetadataNotFound
(a FileNotFoundError subclass) when a dist-info directory has no
METADATA file. Previously, it returned None.

CPython change: python/cpython#146234

radoering pushed a commit to frenzymadness/poetry that referenced this pull request

May 1, 2026
In Python 3.15, importlib.metadata raises MetadataNotFound
(a FileNotFoundError subclass) when a dist-info directory has no
METADATA file. Previously, it returned None.

CPython change: python/cpython#146234