Skip to content

Adjust path_to_url et al. to produce the same results on Python 3.14+ #13423

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hroncok
Copy link
Contributor

@hroncok hroncok commented Jun 12, 2025

See python/cpython#125974 and #13138 (comment)

This makes the tests pass on Fedora with Python 3.14.0b2 (except test_get_index_content_directory_append_index, which segfaults python/cpython#135448)

return urllib.request.pathname2url(urllib.request.url2pathname(part))
ret = urllib.request.pathname2url(urllib.request.url2pathname(part))
if sys.version_info >= (3, 14):
ret = ret.removeprefix("//")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not proud of this :(

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasn't obvious to me how else to do this either 🙁

@notatallshaw
Copy link
Member

With no other feedback, are you planning to remove draft status from this and add a small news item?

I tested this locally and it appears to be good, but because it's slightly changing the behavior of brittle path functions I think there should be a small bug fix note.

@hroncok
Copy link
Contributor Author

hroncok commented Jun 22, 2025

Can do.

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

Successfully merging this pull request may close these issues.

2 participants