[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

Nikolaus Rath report at bugs.python.org
Fri Mar 28 04:45:36 CET 2014


Nikolaus Rath added the comment:

I'm attaching a patch that enables TextIOWrapper to work with bytes-like objects from the underlying file descriptor.

The code changes are pretty small, without introducing any significant additional complexity.

For streams providing bytes objects, this patch does not change anything. For streams that are able to provide bytearrays or memoryviews, this patch removes the overhead that would be incurred by explicitly converting to bytes.

----------
keywords: +patch
Added file: http://bugs.python.org/file34645/issue21057.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21057>
_______________________________________


More information about the Python-bugs-list mailing list