Uh oh!
There was an error while loading. Please reload this page.
gh-67693: Fix urlunparse() and urlunsplit() for URIs with path starting with multiple slashes and no authority - #113563
Conversation
serhiy-storchaka
commented
Dec 29, 2023
It fixes also more serious security issue #67693. |
vadmium
left a comment
There was a problem hiding this comment.
The code changes and tests look good to me.
Uh oh!
There was an error while loading. Please reload this page.
| ('//path/to/file', | ||
| ('', 'path', '/to/file', '', '', ''), | ||
| ('', 'path', '/to/file', '', '')), | ||
| ('////path/to/file', |
There was a problem hiding this comment.
This case was broken.
| ('scheme://path/to/file', | ||
| ('scheme', 'path', '/to/file', '', '', ''), | ||
| ('scheme', 'path', '/to/file', '', '')), | ||
| ('scheme:////path/to/file', |
There was a problem hiding this comment.
This case was broken.
| ('file:///tmp/junk.txt', | ||
| ('file', '', '/tmp/junk.txt', '', '', ''), | ||
| ('file', '', '/tmp/junk.txt', '', '')), | ||
| ('file:////tmp/junk.txt', |
There was a problem hiding this comment.
This case was broken.
| ('file:////tmp/junk.txt', | ||
| ('file', '', '//tmp/junk.txt', '', '', ''), | ||
| ('file', '', '//tmp/junk.txt', '', '')), | ||
| ('file://///tmp/junk.txt', |
There was a problem hiding this comment.
This case was broken.
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9, 3.10, 3.11, 3.12, 3.13. |
GH-119026 is a backport of this pull request to the 3.10 branch. |
…h path starting with multiple slashes and no authority (pythonGH-113563) (cherry picked from commit e237b25) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-119027 is a backport of this pull request to the 3.9 branch. |
… path starting with multiple slashes and no authority (pythonGH-113563) (cherry picked from commit e237b25) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-119028 is a backport of this pull request to the 3.8 branch. |
…h path starting with multiple slashes and no authority (pythonGH-113563) (cherry picked from commit e237b25) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
There was a behavioural change to `urllib.parse.urlunparse`[1] that affects some of our tests on Windows. With the understanding that the new behaviour is indeed desired, split up some tests relying on this behaviour depending on the version of Python. The sample URL used to check this behaviour was taken from a test in the upstream change (with the new behaviour this URL will round-trip parsing) [1] python/cpython#113563
There was a behavioural change to `urllib.parse.urlunparse`[1] that affects some of our tests on Windows. With the understanding that the new behaviour is indeed desired, split up some tests relying on this behaviour depending on the version of Python. The sample URL used to check this behaviour was taken from a test in the upstream change (with the new behaviour this URL will round-trip parsing) [1] python/cpython#113563
…starting with multiple slashes and no authority (pythonGH-113563)
Based on #15297.
Co-authored-by: Ashwin Ramaswami aramaswamis@gmail.com