-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
urllib.request.pathname2url() and url2pathname() remove slashes on Windows #126212
Comments
barneygale
added
type-bug
An unexpected behavior, bug, or error
3.12
bugs and security fixes
3.13
bugs and security fixes
3.14
new features, bugs and security fixes
labels
Oct 30, 2024
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Oct 31, 2024
Adjust `urllib.request.pathname2url()` and `url2pathname()` so that they don't remove slashes from Windows DOS drive paths and URLs. There was no basis for this behaviour, and it conflicts with how UNC and POSIX paths are handled.
barneygale
added a commit
that referenced
this issue
Nov 8, 2024
Adjust `urllib.request.pathname2url()` and `url2pathname()` so that they don't remove slashes from Windows DOS drive paths and URLs. There was no basis for this behaviour, and it conflicts with how UNC and POSIX paths are handled.
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Nov 8, 2024
…onGH-126214) Adjust `urllib.request.pathname2url()` and `url2pathname()` so that they don't remove slashes from Windows DOS drive paths and URLs. There was no basis for this behaviour, and it conflicts with how UNC and POSIX paths are handled. (cherry picked from commit 54c63a3) Co-authored-by: Barney Gale <[email protected]>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Nov 8, 2024
…onGH-126214) Adjust `urllib.request.pathname2url()` and `url2pathname()` so that they don't remove slashes from Windows DOS drive paths and URLs. There was no basis for this behaviour, and it conflicts with how UNC and POSIX paths are handled. (cherry picked from commit 54c63a3) Co-authored-by: Barney Gale <[email protected]>
This was referenced Nov 8, 2024
barneygale
added a commit
that referenced
this issue
Nov 8, 2024
…126214) (#126591) GH-126212: Fix removal of slashes in file URIs on Windows (GH-126214) Adjust `urllib.request.pathname2url()` and `url2pathname()` so that they don't remove slashes from Windows DOS drive paths and URLs. There was no basis for this behaviour, and it conflicts with how UNC and POSIX paths are handled. (cherry picked from commit 54c63a3) Co-authored-by: Barney Gale <[email protected]>
barneygale
added a commit
that referenced
this issue
Nov 8, 2024
…126214) (#126590) GH-126212: Fix removal of slashes in file URIs on Windows (GH-126214) Adjust `urllib.request.pathname2url()` and `url2pathname()` so that they don't remove slashes from Windows DOS drive paths and URLs. There was no basis for this behaviour, and it conflicts with how UNC and POSIX paths are handled. (cherry picked from commit 54c63a3) Co-authored-by: Barney Gale <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Bug description:
urllib.request.pathname2url()
unexpectedly removes doubled and trailing slashes, but only on Windows, and only for DOS device paths (not UNC paths):url2pathname()
does almost the same thing, except that it specially preserves a slash immediately after a DOS drive (but not elsewhere):This behaviour makes no sense and has no equivalent on POSIX, where all slashes are preserved.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Windows
Linked PRs
The text was updated successfully, but these errors were encountered: