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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants