Skip to content

HTMLPage PEP 503 compliance #6272

Open
Open
@uranusjr

Description

@uranusjr

In pip._internal.index, links on a simple API page are found with the following:

  1. a[href] values are collected
  2. the filename part is parsed for metadata

But here’s how PEP 503 describes the a tags on an individual project page:

The text of the anchor tag MUST be the filename of the file and the href attribute MUST be an URL that links to the location of the file for download.

A linked file’s name is specified by the text, and there’s no guarantee that the link’s filename part should match it. So instead of parsing the link, pip should use the a tag’s text instead to parse for metadata.

Am I interpreting the PEP text correctly? If so, should pip be fixed to follow the spec, or should we just fix the PEP to say the URL’s filename part must match the text (since existing implementations all already do this anyway in order to work)?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions