-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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-67693: Fix urlunparse() and urlunsplit() for URIs with path starting with multiple slashes and no authority #113563
Changes from 9 commits
ff16c46
151e39c
0e177fd
eea029d
cc9067b
fb03e5f
26951a7
7f495b0
f5ab0c1
62957fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,9 +175,39 @@ def test_qs(self): | |
|
||
def test_roundtrips(self): | ||
str_cases = [ | ||
('path/to/file', | ||
('', '', 'path/to/file', '', '', ''), | ||
('', '', 'path/to/file', '', '')), | ||
('/path/to/file', | ||
('', '', '/path/to/file', '', '', ''), | ||
('', '', '/path/to/file', '', '')), | ||
('//path/to/file', | ||
('', 'path', '/to/file', '', '', ''), | ||
('', 'path', '/to/file', '', '')), | ||
('////path/to/file', | ||
('', '', '//path/to/file', '', '', ''), | ||
('', '', '//path/to/file', '', '')), | ||
('scheme:path/to/file', | ||
('scheme', '', 'path/to/file', '', '', ''), | ||
('scheme', '', 'path/to/file', '', '')), | ||
('scheme:/path/to/file', | ||
('scheme', '', '/path/to/file', '', '', ''), | ||
('scheme', '', '/path/to/file', '', '')), | ||
('scheme://path/to/file', | ||
('scheme', 'path', '/to/file', '', '', ''), | ||
('scheme', 'path', '/to/file', '', '')), | ||
('scheme:////path/to/file', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This case was broken. |
||
('scheme', '', '//path/to/file', '', '', ''), | ||
('scheme', '', '//path/to/file', '', '')), | ||
('file:///tmp/junk.txt', | ||
('file', '', '/tmp/junk.txt', '', '', ''), | ||
('file', '', '/tmp/junk.txt', '', '')), | ||
('file:////tmp/junk.txt', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This case was broken. |
||
('file', '', '//tmp/junk.txt', '', '', ''), | ||
('file', '', '//tmp/junk.txt', '', '')), | ||
('file://///tmp/junk.txt', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This case was broken. |
||
('file', '', '///tmp/junk.txt', '', '', ''), | ||
('file', '', '///tmp/junk.txt', '', '')), | ||
('imap://mail.python.org/mbox1', | ||
('imap', 'mail.python.org', '/mbox1', '', '', ''), | ||
('imap', 'mail.python.org', '/mbox1', '', '')), | ||
|
serhiy-storchaka marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Fix :func:`urllib.parse.urlunparse` and :func:`urllib.parse.urlunsplit` for URIs with path starting with multiple slashes and no authority. | ||
Based on patch by Ashwin Ramaswami. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case was broken.