FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: better error message for broken Distribution objects (#508) by DawnofGenX · Pull Request #546 · python/importlib_metadata · GitHub

Repository navigation

fix: better error message for broken Distribution objects (#508) - #546

Merged
jaraco merged 3 commits into
python:mainfrom
DawnofGenX:main
Oct 21, 2026
Merged

jaraco merged 3 commits into
python:mainfrom
DawnofGenX:main

Conversation

DawnofGenX commented Oct 8, 2026 •
edited
Loading

Copy link
Copy Markdown
Contributor

Summary

Fixes #508: Better error message when a Distribution object is broken (missing Name metadata).

Changes

  • property now wraps the with the distribution path context
  • Added test for the new error message

Testing

  • 40/40 tests pass
  • New test verifies the error message contains useful context

Comment thread importlib_metadata/__init__.py Outdated
Comment thread importlib_metadata/__init__.py Outdated
jaraco and others added 2 commits October 21, 2026 14:43
… path.

Replace the Name-specific handling with an `_identify_dist` decorator
applied to both required metadata accessors, and give PathDistribution a
`__str__` that emits its metadata path so the error (and diagnose) can
rely on rendering the distribution rather than reaching for `_path`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
jaraco merged commit a7c26f4 into python:main Oct 21, 2026
17 of 18 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

Better identification of broken Distribution objects

2 participants


Back | FazBrowse Home | New Git URL