Skip to content

Should pip use PEP 691 JSON filename when the URL basename is not a filename? #14113

Description

@2ykwang

I may be missing some history here, but pip seems to use the download URL basename as the candidate filename for PEP 691 JSON entries.

This is probably niche, since PyPI URLs appear to end with the distribution filename. but PEP 691 defines filename separately from url, and its FAQ notes that it is not clear whether repositories always expose the filename as the last part of the URL. 1

with an entry like this:

{
  "filename": "simplewheel-1.0-py2.py3-none-any.whl",
  "url": "/download/simplewheel",
  "hashes": {}
}

pip seems to treat the URL basename simplewheel as the filename and skips the entry as not a file before downloading, despite the valid JSON filename. the same wheel installs when the URL ends with the wheel filename.

should pip use the JSON filename field for candidate filename detection in this case, or is relying on the URL basename intentional?

Footnotes

  1. PEP 691 - why-include-the-filename-when-the-url-has-it-already)

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