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

GH-65238: Fix stripping of trailing slash in pathlib #103595

Closed
wants to merge 3 commits into from

Conversation

barneygale
Copy link
Contributor

@barneygale barneygale commented Apr 17, 2023

This brings pathlib in line with IEEE Std 1003.1-2017, where trailing slashes are meaningful to path resolution and should not be discarded.

This is the last known bug in pathlib's path normalization. Fixing such bugs is necessary if we're to return an unnormalized path from Path.__fspath__() as an optimization - see #102783. It is also helpful for solving #79634 and #102613.

Although most bugfixes involve changing behaviour, in this case the change is reasonably significant. As such I'd like this to land early in the 3.13 alpha cycle and to skip backporting.

This brings pathlib in line with *IEEE Std 1003.1-2017*, where trailing
slashes are meaningful to path resolution and should not be discarded.

See https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13
@barneygale
Copy link
Contributor Author

Closing this PR as the change is too invasive to make right now. zipfile.Path's use of trailing slashes can't be reconciled with what I'm attempting to do. It's possible that zipfile.Path will inherit from a pathlib class in future, which would help address this, but it's not practical yet.

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