Martin Panter added the comment:
Patch v2 just changes a test to use “with self.assertRaises()”.
The behaviour of urlparse() succeeding and then result.port failing is indeed
odd and surprising. Hopefully documenting this behaviour will help with the
“surprising” aspect. But changing it would surely break compatibility. For
example, the following is still potentially useful:
>>> urlsplit("http://localhost:ipp/").netloc
'localhost:ipp'
On Unix, some programs look up port names in /etc/services, even though this is
not valid for URLs according to the RFCs, and urlsplit().port does not support
it. In this case “ipp” would be whatever port the Internet Printing Protocol
server is configured to run on.
----------
Added file: http://bugs.python.org/file38642/port-ValueError.v2.patch
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue20059>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com