Author ncoghlan
Recipients ncoghlan
Date 2010-09-16.13:25:09
SpamBayes Score 1.48772e-07
Marked as misclassified No
Message-id <1284643512.64.0.708677047597.issue9873@psf.upfronthosting.co.za>
In-reply-to
Content
As per python-dev discussion in June, many Py3k APIs currently gratuitously prevent the use of bytes and bytearray objects as arguments due to their use of string literals internally.

Examples:
urllib.parse.urlparse
urllib.parse.urlunparse
urllib.parse.urljoin
urllib.parse.urlsplit
(and plenty of other examples in urllib.parse)

While a strict reading of the relevant RFCs suggests that strings are the more appropriate type for these APIs, as a practical matter, protocol developers want to be able to operate on ASCII supersets as raw bytes.

The proposal is to modify the implementation of these functions such that string literals are used only with string arguments, and bytes literals otherwise. If a function accepts multiple values and a mixture of strings and bytes is passed in then the operation will still fail (as it should).
History
Date User Action Args
2010-09-16 13:25:14ncoghlansetrecipients: + ncoghlan
2010-09-16 13:25:12ncoghlansetmessageid: <1284643512.64.0.708677047597.issue9873@psf.upfronthosting.co.za>
2010-09-16 13:25:10ncoghlanlinkissue9873 messages
2010-09-16 13:25:09ncoghlancreate