python / python/importlib_metadata
`PackagePath` does not support Windows paths
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 142
- Forks
- 97
- PR merge metrics
- No merged PRs in 30d
Description
Currently, importlib.metadata.files assumes that path are Unix-style with forward slashes, while the spec allows Windows-style backwards slashes too. This causes e.g. the .name on items to be inconsistent between platforms (https://github.com/astral-sh/uv/issues/14446).
From https://packaging.python.org/en/latest/specifications/recording-installed-packages/#the-record-file
The path may be either absolute, or relative to the directory containing the .dist-info directory (commonly, the site-packages directory). On Windows, directories may be separated either by forward- or backslashes (/ or ).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in importlib_metadata/init.py around the referenced PackagePath implementation and compare its handling of forward- and backslash-separated paths with the RECORD specification. Add coverage for Windows-style paths and verify that the resulting .name is consistent across path separators.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100