Skip to content

Raise an exception when no metadata file is found#532

Merged
jaraco merged 5 commits intomainfrom
feature/no-metadata-exception
Mar 20, 2026
Merged

Raise an exception when no metadata file is found#532
jaraco merged 5 commits intomainfrom
feature/no-metadata-exception

Conversation

@jaraco
Copy link
Member

@jaraco jaraco commented Mar 7, 2026

When exploring python/cpython#143387, it became apparent that the None return type for Distribution.metadata() has unexpected downstream behaviors (where resolution of metadata values raises an unexpected AttributeError when None has no get_all).

This change proposes that instead, when no metadata file is present, the API should raise an Exception, specifically, a FileNotFoundError subclass.

@jaraco jaraco marked this pull request as ready for review March 20, 2026 00:24
@jaraco jaraco merged commit 9b0dfdf into main Mar 20, 2026
30 checks passed
@jaraco jaraco deleted the feature/no-metadata-exception branch March 20, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant