[issue25863] ISO-2022 seeking forgets state

2016-01-19 Thread Martin Panter
Martin Panter added the comment: After thinking about Issue 26158, I realize the seek() magic numbers don’t store any _encoder_ state, only _decoder_ state. That would explain the first bug (write, seek, then read). Though for this codec I suspect the decoder state is not recorded either, henc

[issue25863] ISO-2022 seeking forgets state

2015-12-29 Thread John Walker
John Walker added the comment: Here is Martin's message as a unit test. It checks utf-8 and the iso-2022 family except iso-2022-cn and iso-2022-cn-ext because they are not supported. The errors occur with all iso-2022 charsets. -- keywords: +patch Added file: http://bugs.python.org/fil

[issue25863] ISO-2022 seeking forgets state

2015-12-29 Thread John Walker
Changes by John Walker : -- nosy: +johnwalker ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue25863] ISO-2022 seeking forgets state

2015-12-28 Thread Ezio Melotti
Ezio Melotti added the comment: I confirmed the problem on default (3.6) and verified that it works as expected using utf-8 instead of iso-2022-jp. The code in the above message should be converted into a unittest, and related codecs should be checked as well. The problem is probably in Modules

[issue25863] ISO-2022 seeking forgets state

2015-12-18 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue25863] ISO-2022 seeking forgets state

2015-12-14 Thread Martin Panter
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'" >>> te