[issue31271] an assertion failure in io.TextIOWrapper.write

Oren Milman report at bugs.python.org
Fri Aug 25 03:48:40 EDT 2017


Oren Milman added the comment:

As Serhiy pointed out on github, the assertion failure can be easily reproduced
by the following:

import codecs
import io

rot13 = codecs.lookup("rot13")
rot13._is_text_encoding = True
t = io.TextIOWrapper(io.BytesIO(b'foo'), encoding="rot13")
t.write('bar')

----------

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


More information about the Python-bugs-list mailing list