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: 
<https://tools.ietf.org/html/rfc3986#section-3.2.3>

The “port” subcomponent of “authority” is designated by an optional port number 
in decimal following the host and delimited from it by a single colon. . . . 
URI producers and normalizers should omit the port component and its “:” 
delimiter if “port” is empty . . .

What problem are you trying to solve by raising an error?

See also Issue 20059, where accessing the “port” field now raises ValueError 
for out-of-range values, and Issue 20271, discussing invalid URL handling more 
generally.

----------
nosy: +martin.panter

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28841>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to