Message116543
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). |
|
Date |
User |
Action |
Args |
2010-09-16 13:25:14 | ncoghlan | set | recipients:
+ ncoghlan |
2010-09-16 13:25:12 | ncoghlan | set | messageid: <1284643512.64.0.708677047597.issue9873@psf.upfronthosting.co.za> |
2010-09-16 13:25:10 | ncoghlan | link | issue9873 messages |
2010-09-16 13:25:09 | ncoghlan | create | |
|