This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients berker.peksag, chad.birch, cvrebert, demian.brecht, martin.panter, orsenthil, serhiy.storchaka
Date 2015-03-23.04:57:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
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

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.
Date User Action Args
2015-03-23 04:57:00martin.pantersetrecipients: + martin.panter, orsenthil, cvrebert, berker.peksag, serhiy.storchaka, demian.brecht, chad.birch
2015-03-23 04:57:00martin.pantersetmessageid: <>
2015-03-23 04:57:00martin.panterlinkissue20059 messages
2015-03-23 04:57:00martin.pantercreate