[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2019-08-26 Thread Ashwin Ramaswami
Change by Ashwin Ramaswami : -- versions: +Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2019-08-14 Thread Ashwin Ramaswami
Change by Ashwin Ramaswami : -- keywords: +patch pull_requests: +15020 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15297 ___ Python tracker ___

[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2019-08-14 Thread Ashwin Ramaswami
Change by Ashwin Ramaswami : -- nosy: +epicfaace ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2018-09-06 Thread Vladimir Matveev
Vladimir Matveev added the comment: file URI scheme is covered by RFC8089, specifically https://tools.ietf.org/html/rfc8089#appendix-E.3.2. -- nosy: +v2m ___ Python tracker _

[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2018-07-31 Thread Martin Panter
Martin Panter added the comment: Yes urllib doesn’t distinguish a missing authority/netloc from an empty string. The same for the ?query and #fragment parts. There is Issue 22852 open about that. -- ___ Python tracker

[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2018-07-31 Thread Piotr Dobrogost
Change by Piotr Dobrogost : -- nosy: +piotr.dobrogost ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2018-07-31 Thread Chris Jerdonek
Chris Jerdonek added the comment: > The RFC treats empty authority and no authority as different cases. I'm not well-versed on this. But I guess this means urllib.parse doesn't support this distinction. For example: >>> urllib.parse.urlsplit('file:/foo') SplitResult(scheme='file', netloc

[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2018-07-30 Thread Martin Panter
Martin Panter added the comment: I think your URLs are valid by RFC 3986. "When authority is not present" refers to URLs without the double-slash prefix, like the "urn:example:animal:ferret:nose". The RFC treats empty authority and no authority as different cases. If authority is present, th

[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2018-07-30 Thread Chris Jerdonek
Chris Jerdonek added the comment: Thanks for all the extra info. A couple more comments: 1. I came across this issue when diagnosing the following pip issue ("pip install git+file://" not working for Windows UNC paths): https://github.com/pypa/pip/issues/3783 2. URLs of the form "file:ro

[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2018-07-30 Thread Martin Panter
Martin Panter added the comment: This may be a very old regression (from 2002) caused by Issue 591713 and Mercurial rev. 554f975073a0. The original check for the double slash, added in 0d6bd391acd8, “escapes” a path beginning with a double slash by prefixing it with two more slashes (empty “n

[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2018-07-30 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I just checked back the behavior on Perl's https://github.com/libwww-perl/URI/ . It seems to handle that along with other additional cases. Maybe some of the tests can be adopted from there for better coverage too (https://github.com/libwww-perl/UR

[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2018-07-30 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: This is an issue with Python 2 too which I hope can be fixed too. The original logic in the code was committed around 16 years back : https://github.com/python/cpython/commit/bbc0568a5c7d3849a22c78d545823a4b952c0933 and tests are also around 10 year

[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2018-07-29 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue34276] urllib.parse doesn't round-trip file URI's with multiple leading slashes

2018-07-29 Thread Chris Jerdonek
New submission from Chris Jerdonek : urllib.parse doesn't seem to round-trip file URI's containing multiple leading slashes. For example, this-- import urllib.parse def round_trip(url): parsed = urllib.parse.urlsplit(url) new_url = urllib.parse.urlunsplit(parsed)