New submission from Martin Panter: >>> from io import * >>> text = TextIOWrapper(BytesIO(), "iso-2022-jp") >>> text.write(u"P") 1 >>> text.tell() 1 >>> text.write(u"anter 正") 7 >>> text.tell() 12 >>> text.write(u"孝") 1 >>> text.seek(12) 12 >>> text.read() # Should return 孝, not ASCII "9'" >>> text.buffer.getvalue() b"Panter \x1b$B@59'" >>> text.seek(1) 1 >>> text.read(7) 'anter 正' >>> text.tell() # Another bug? Traceback (most recent call last): File "<stdin>", line 1, in <module> UnicodeDecodeError: 'iso2022_jp' codec can't decode bytes in position 2-3: illegal multibyte sequence
---------- components: IO, Unicode messages: 256431 nosy: ezio.melotti, haypo, martin.panter priority: normal severity: normal status: open title: ISO-2022 seeking forgets state type: behavior versions: Python 2.7, Python 3.5, Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25863> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com