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

pathname2url() does not work if path starts with // #127217

Closed
serhiy-storchaka opened this issue Nov 24, 2024 · 0 comments
Closed

pathname2url() does not work if path starts with // #127217

serhiy-storchaka opened this issue Nov 24, 2024 · 0 comments
Labels
3.12 bugs and security fixes 3.13 bugs and security fixes 3.14 new features, bugs and security fixes type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented Nov 24, 2024

Bug report

For example:

>>> from urllib.request import pathname2url
>>> 'file:' + pathname2url('//foo/bar')
'file://foo/bar'

This is a file URI with path "/bar" and authority "foo". Non-empty authority other than "localhost" are usually rejected. The right URI for path "//foo/bar" is "file:////foo/bar" -- an URI with explicit empty authority.

Similar bug in urlunparse() and urlunsplit() was fixed in #67693.

Linked PRs

@serhiy-storchaka serhiy-storchaka 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 Nov 24, 2024
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Nov 24, 2024
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Nov 24, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 24, 2024
…slashes on Posix (pythonGH-127218)

(cherry picked from commit 97b2cea)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 24, 2024
…slashes on Posix (pythonGH-127218)

(cherry picked from commit 97b2cea)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
barneygale added a commit to barneygale/cpython that referenced this issue Nov 24, 2024
serhiy-storchaka added a commit that referenced this issue Nov 24, 2024
… slashes on Posix (GH-127218) (GH-127231)

(cherry picked from commit 97b2cea)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this issue Nov 30, 2024
… slashes on Posix (GH-127218) (GH-127230)

(cherry picked from commit 97b2cea)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes 3.13 bugs and security fixes 3.14 new features, bugs and security fixes type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant