[issue43871] urllib.parse.urlparse doesn't check port

2021-05-01 Thread Miguel Brito
Miguel Brito added the comment: I also think the validation logic should be ran as early as possible. I gave it a shot and implemented it. I appreciate any reviews: https://github.com/python/cpython/pull/25774 Got some ideas from https://github.com/python/cpython/pull/16780 -- ___

[issue43871] urllib.parse.urlparse doesn't check port

2021-05-01 Thread Miguel Brito
Change by Miguel Brito : -- keywords: +patch nosy: +miguendes nosy_count: 4.0 -> 5.0 pull_requests: +24464 stage: -> patch review pull_request: https://github.com/python/cpython/pull/25774 ___ Python tracker ___

[issue43871] urllib.parse.urlparse doesn't check port

2021-04-17 Thread Alexei Pastuchov
Alexei Pastuchov added the comment: Thank you for your swift response and your willingness to add port validation to _checknetloc. I think the validation itself should compound both exceptional branches implemented in port[3] * port is an int * port is in the range [3] https://github.com/p

[issue43871] urllib.parse.urlparse doesn't check port

2021-04-17 Thread Senthil Kumaran
Change by Senthil Kumaran : -- assignee: -> orsenthil versions: +Python 3.10 ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue43871] urllib.parse.urlparse doesn't check port

2021-04-17 Thread Senthil Kumaran
Senthil Kumaran added the comment: Treating this as bug in itself might be a better idea than waiting for a ipv6 scope introduction, which had few caveats. > Would it be an improvement if _checknetloc[2] validates the value of port > properly? Yes, we could check if it is an int. That shou

[issue43871] urllib.parse.urlparse doesn't check port

2021-04-16 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I guess moving port validation logic to parsing time is done as part of https://github.com/python/cpython/pull/16780 -- nosy: +orsenthil, vstinner, xtreak ___ Python tracker

[issue43871] urllib.parse.urlparse doesn't check port

2021-04-16 Thread Alexei Pastuchov
New submission from Alexei Pastuchov : It is possible to get valid ParseResult from the urlparse function even for a non-numeric port value. Only by requesting the port it fails[1]. Would it be an improvement if _checknetloc[2] validates the value of port properly? // code snippet Python 3.8