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 <rep...@bugs.python.org> <http://bugs.python.org/issue31271> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com