[issue28841] urlparse.urlparse() parses invalid URI without generating an error (examples provided)

2021-12-10 Thread Irit Katriel
Irit Katriel added the comment: Reproduced on 3.11: >>> urllib.parse.urlparse('http://www.google.com:/abc') ParseResult(scheme='http', netloc='www.google.com:', path='/abc', params='', query='', fragment='') The discussion above was mostly leaning towards won't fix, except for the

[issue28841] urlparse.urlparse() parses invalid URI without generating an error (examples provided)

2016-11-30 Thread R. David Murray
R. David Murray added the comment: Yes, I'm afraid so. But the rationale is presumably the same as it is in many RFCs: you should accept broken stuff if it can be interpreted unambiguously, but you should not *produce* the broken stuff. So I'd say the RFC is correct as quoted. It is then

[issue28841] urlparse.urlparse() parses invalid URI without generating an error (examples provided)

2016-11-30 Thread Amrith Kumar
Amrith Kumar added the comment: Eric, Martin, I'm sure this is an interpretation (and I'll be fair and give you both) that a URL of the form: http://hostname.domain.tld:/path should be held invalid. The rationale is per the section of the spec you quoted. The other side of the argument is

[issue28841] urlparse.urlparse() parses invalid URI without generating an error (examples provided)

2016-11-30 Thread Eric V. Smith
Eric V. Smith added the comment: And note that there are tests that explicitly check that the colon with no port works (via issue 20270). Given that this behavior has been around for a while, and is explicitly allowed, I would recommend against changing this to an error. --

[issue28841] urlparse.urlparse() parses invalid URI without generating an error (examples provided)

2016-11-30 Thread Martin Panter
Martin Panter added the comment: Also, this is in direct contradiction to Issue 20270. -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue28841] urlparse.urlparse() parses invalid URI without generating an error (examples provided)

2016-11-30 Thread Martin Panter
Martin Panter added the comment: The Python documentation refers to RFC 3986, which allows an empty port string introduced by a colon, although it recommends against it: The “port” subcomponent of “authority” is designated by an optional

[issue28841] urlparse.urlparse() parses invalid URI without generating an error (examples provided)

2016-11-30 Thread Amrith Kumar
Amrith Kumar added the comment: As requested ... >>> urlparse.urlparse('http://www.google.com:/abc') ParseResult(scheme='http', netloc='www.google.com:', path='/abc', params='', query='', fragment='') I submit to you that this should generate an error. --

[issue28841] urlparse.urlparse() parses invalid URI without generating an error (examples provided)

2016-11-30 Thread Eric V. Smith
Eric V. Smith added the comment: Can you please paste your code into a comment on this issue? Gist content has a habit of vanishing. Thanks! -- nosy: +eric.smith ___ Python tracker

[issue28841] urlparse.urlparse() parses invalid URI without generating an error (examples provided)

2016-11-30 Thread SilentGhost
Changes by SilentGhost : -- nosy: +orsenthil versions: +Python 3.5, Python 3.6, Python 3.7 -Python 3.4 ___ Python tracker ___

[issue28841] urlparse.urlparse() parses invalid URI without generating an error (examples provided)

2016-11-30 Thread Amrith Kumar
New submission from Amrith Kumar: The urlparse library incorrectly accepts a URI which specifies an invalid host identifier. Example: http://www.example.com:/abc Looking at the URI specifications, this is an invalid URI. By definition, you are supposed to specify a "hostport" and a hostport