Skip to content

PackagePath does not support Windows paths #528

@konstin

Description

@konstin

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 (astral-sh/uv#14446).

class PackagePath(pathlib.PurePosixPath):

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 ).

Ref #51

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions