[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

Nikolaus Rath report at bugs.python.org
Tue Apr 1 06:19:11 CEST 2014


Nikolaus Rath added the comment:

Thanks for the feedback! I have attached an updated patch.

I did not include any testcase because the patch did not create any new code paths, so I was assuming it'd be covered by the existing test case. But of course I was wrong. In the revised patch, I added a testcase based on your example of a more complex memoryview.

(Note, however, that even with the previous implementation using nbytes = PySequence_Size(input_chunk) this test does not fail, because nbytes is used only to estimate the size of the text string).

----------
Added file: http://bugs.python.org/file34690/issue21057.diff

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


More information about the Python-bugs-list mailing list