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 benjamin.peterson, martin.panter, pitrou, serhiy.storchaka, stutzbach
Date 2015-09-21.06:52:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1442818333.87.0.949020098574.issue25190@psf.upfronthosting.co.za>
In-reply-to
Content
I see the _pyio implementation wraps BytesIO with UTF-8 encoding. Perhaps it would be okay to change to UTF-32 encoding (a fixed-length Unicode encoding). That would use more memory, but the C implementation seems to use a Py_UCS4 buffer already. Then you could reimplement seek(), tell(), and truncate() by detaching and rebuilding the TextIOWrapper over the top. Not super efficient, but perhaps that does not matter for the _pyio implementation.

The fact that it is so hard to do this (random write access to a large Unicode buffer) in native Python could be another argument to support this in the default StringIO implementation :)
History
Date User Action Args
2015-09-21 06:52:13martin.pantersetrecipients: + martin.panter, pitrou, benjamin.peterson, stutzbach, serhiy.storchaka
2015-09-21 06:52:13martin.pantersetmessageid: <1442818333.87.0.949020098574.issue25190@psf.upfronthosting.co.za>
2015-09-21 06:52:13martin.panterlinkissue25190 messages
2015-09-21 06:52:13martin.pantercreate