This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author methane
Recipients libcthorne, martin.panter, methane
Date 2018-06-05.08:20:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1528186837.02.0.592728768989.issue33578@psf.upfronthosting.co.za>
In-reply-to
Content
ISO-2022-* is "stateful" encoding.  It uses escape sequence to change state.
So keeping only `pending` is not enough.

>>> enc.encode("abcあいう")
b'abc\x1b$B$"$$$&'
>>> enc.getstate()
0
>>> enc.encode("abc")
b'\x1b(Babc'

>>> enc.encode("abcあいう")
b'abc\x1b$B$"$$$&'
>>> enc.getstate()
0
>>> enc.setstate(0)
>>> enc.encode("abc")
b'abc'

I don't know much about other encodings.
History
Date User Action Args
2018-06-05 08:20:37methanesetrecipients: + methane, martin.panter, libcthorne
2018-06-05 08:20:37methanesetmessageid: <1528186837.02.0.592728768989.issue33578@psf.upfronthosting.co.za>
2018-06-05 08:20:37methanelinkissue33578 messages
2018-06-05 08:20:36methanecreate