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

pathlib.Path drops '//' (naturally), but it's sometimes used for URLs #670

Merged
merged 1 commit into from Aug 11, 2022

Conversation

jpivarski
Copy link
Member

So if a path from pathlib.Path starts with "http:/" and no second slash (also for "file", "https", "root" URL schemes, case insensitive), then a second slash will be added.

pathlib.Path is our recommended way of saying, "This really is a path, even though it has a colon in it," but we didn't foresee this issue with URLs with colons in them.

There's another way of doing it with {filename: None} instead of pathlib.Path(filename), which doesn't suffer from this, but enough people are probably doing the pathlib.Path thing that we need this small correction.

@jpivarski jpivarski linked an issue Aug 11, 2022 that may be closed by this pull request
@jpivarski jpivarski enabled auto-merge (squash) August 11, 2022 18:38
@jpivarski jpivarski merged commit c7d7282 into main Aug 11, 2022
@jpivarski jpivarski deleted the jpivarski/fix-URLs-passed-through-pathlib.Path branch August 11, 2022 18:53
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.

Accessing ROOT files with colons and double slashes in the path
1 participant