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

Correct usage of invalid file URL in test #12964

Merged
merged 3 commits into from
Oct 8, 2024

Conversation

freakboy3742
Copy link
Contributor

In the process of diagnosing test failures in #12962, I discovered that there has been a change in Python 3.13.0rc2 (that wasn't in rc1) that breaks the pip test suite.

The underlying cause is python/cpython#85110, which has been back ported to 3.13 and 3.12. Previously, the following code:

>>> from urllib.parse import urlunsplit
>>> urlunsplit(('file', '', 'nonexistent', '', ''))
'file:///nonexistent'

whereas it now returns:

file:nonexistent

This poses a problem because the absence of the file:// means that the appropriate URL handler isn't installed, resulting in a failure of "ERROR: Could not install packages due to an OSError: No connection adapters were found for 'file:unexistent_file'" rather than "ERROR: 404 Client Error: FileNotFoundError for url: file:///unexistent_file".

The new behavior seems correct - file:unexistent_file isn't a valid File URL; and it definitely isn't equivalent to file:///unexistent_file (at best, it would be equivalent to file://unexistent_file).

This PR updates the test case to use a valid, but non-existent file URL (which seems to be the point of the test).

@freakboy3742
Copy link
Contributor Author

@uranusjr Just to confirm I haven't missed something here - is there anything pending on me for this PR?

@freakboy3742
Copy link
Contributor Author

@uranusjr Friendly poke on this; what (if anything) is preventing a merge on this PR?

@uranusjr uranusjr merged commit dfbe41e into pypa:main Oct 8, 2024
34 checks passed
@freakboy3742 freakboy3742 deleted the file-url-fix branch October 8, 2024 04:19
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants