Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails with PEP 503-compliant XML-serialised HTML5 ("XHTML5") directory indices #6697

Closed
stephen-dexda opened this issue Jul 10, 2019 · 8 comments
Labels
auto-locked Outdated issues that have been locked by automation PEP implementation Involves some PEP state: needs discussion This needs some more discussion

Comments

@stephen-dexda
Copy link

stephen-dexda commented Jul 10, 2019

Environment

  • pip version: 19.1.1
  • Python version: 3.7

Description

PEP 503 states that each directory index must be a "valid HTML5 page". XML is a valid serialisation of HTML5, but e.g. package installation fails when presented with XML-serialised HTML5 ("XHTML5").

Expected behavior
pip supports XML-serialised HTML5, or PEP 503 mentions this restriction.

How to Reproduce

Serve a page with the content type "application/xhtml+xml", that begins with:

<html xmlns="http://www.w3.org/1999/xhtml">

Output

$ pip install -i <repo-root> <pkg>
Looking in indexes: <repo-root>
Collecting <pkg>
  ERROR: Could not find a version that satisfies the requirement <pkg> (from versions: none)
ERROR: No matching distribution found for <pkg>

How to not reproduce

Serve an otherwise identical page, but with the content type "text/html", and that begins with:

<!DOCTYPE html>
<html>
@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Jul 10, 2019
@cjerdonek
Copy link
Member

What does using the verbose option show out of curiosity?

@stephen-dexda
Copy link
Author

Skipping page <repo-root><pkg> because the GET request got Content-Type: application/xhtml+xml :J

@pfmoore
Copy link
Member

pfmoore commented Jul 12, 2019

Whichever choice we make, I suggest PEP 503 should get a clarification stating which content-type(s) the index must be served with. (in cases where a content type is supplied at all - I don't see anything that disallows an index having a base URL that's a file: URL, which won't get a content type).

IMO, requiring text/html is the simplest option, and I don't see a sufficiently strong justification for allowing XHTML (at least, not strong enough to justify requiring all compliant clients to support that case).

@cjerdonek
Copy link
Member

Also, should that skip message be a warning rather than a debug message?

@stephen-dexda
Copy link
Author

stating which content-type(s) the index must be served with

And the serialisation as well, since the body differs too per above - XHTML-serialised HTML5 doesn't mandate !DOCTYPE.

@chrahunt
Copy link
Member

@cjerdonek, made #6754 to discuss.

@chrahunt
Copy link
Member

Created python/peps#1126 to follow up on the PEP 503 update. Is there anything else we need to track here?

@chrahunt chrahunt added PEP implementation Involves some PEP state: needs discussion This needs some more discussion labels Jul 20, 2019
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Jul 20, 2019
@pradyunsg
Copy link
Member

Nope. Thanks @chrahunt!

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Aug 20, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation PEP implementation Involves some PEP state: needs discussion This needs some more discussion
Projects
None yet
Development

No branches or pull requests

5 participants