[issue33034] urllib.parse.urlparse and urlsplit not raising ValueError for bad port

Matt Eaton report at bugs.python.org
Fri Mar 30 18:50:15 EDT 2018


Matt Eaton <agnosticdev at gmail.com> added the comment:

I was able to get some time together today and created a rough draft for the idea that you had Berker on introducing a new API with more strict parsing rules.

This will allow the ValueError to be raised when the URL is parsed rather than when the computed property is used.  

Jonathan, this will help address your concern on the consistency of when the error message is raised.

I added the rough draft on my Github account here:
https://github.com/agnosticdev/cpython-apis/tree/master/url
https://github.com/agnosticdev/cpython-apis/blob/master/url/url.py

Please take a look and let me know what you think.
You can contact me directly to continue the conversation at my email: agnosticdev at gmail.com

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33034>
_______________________________________


More information about the Python-bugs-list mailing list