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 <1427086620.64.0.430516538197.issue20059@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
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: <1427086620.64.0.430516538197.issue20059@psf.upfronthosting.co.za>
2015-03-23 04:57:00martin.panterlinkissue20059 messages
2015-03-23 04:57:00martin.pantercreate