Author martin.panter
Recipients chad.birch, cvrebert, martin.panter, serhiy.storchaka
Date 2014-12-17.04:03:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1418789028.15.0.814790104172.issue20059@psf.upfronthosting.co.za>
In-reply-to
Content
I would go for raising ValueError for port numbers out of range. The value of None was already defined to mean that no port is included in the URL.

Also, the ValueError exception should be documented. It is surprising that urlsplit() does not raise any exception, but then simply getting the “port” attribute does raise the exception.

BTW your third example is wrong:

>>> urlparse("http://www.example.com:").port is None
True

It’s probably safest to keep this one as it is, but maybe it also needs documenting :)
History
Date User Action Args
2014-12-17 04:03:48martin.pantersetrecipients: + martin.panter, cvrebert, serhiy.storchaka, chad.birch
2014-12-17 04:03:48martin.pantersetmessageid: <1418789028.15.0.814790104172.issue20059@psf.upfronthosting.co.za>
2014-12-17 04:03:48martin.panterlinkissue20059 messages
2014-12-17 04:03:47martin.pantercreate