Author martin.panter
Recipients ezio.melotti, martin.panter, vstinner
Date 2015-01-16.06:17:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1421389070.93.0.922548564015.issue23247@psf.upfronthosting.co.za>
In-reply-to
Content
$ python3 -c 'import codecs; from io import BytesIO; codecs.getwriter("big5")(BytesIO()).reset()'
Segmentation fault (core dumped)
[Exit 139]

Happens for all the multibyte codecs:
broken_stream_codecs = {
    "big5", "big5hkscs", "cp932", "cp949", "cp950",
    "euc_jp", "euc_jis_2004", "euc_jisx0213", "euc_kr",
    "gb2312", "gbk", "gb18030", "hz",
    "iso2022_jp", "iso2022_jp_1", "iso2022_jp_2", "iso2022_jp_2004",
    "iso2022_jp_3", "iso2022_jp_ext", "iso2022_kr",
    "johab", "shift_jis", "shift_jis_2004", "shift_jisx0213",
}

These codecs also share the property that their StreamReader.read() methods do not accept the second “chars” parameter:

>>> codecs.getreader("big5")(BytesIO()).read(1, 1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: read expected at most 1 arguments, got 2
History
Date User Action Args
2015-01-16 06:17:51martin.pantersetrecipients: + martin.panter, vstinner, ezio.melotti
2015-01-16 06:17:50martin.pantersetmessageid: <1421389070.93.0.922548564015.issue23247@psf.upfronthosting.co.za>
2015-01-16 06:17:50martin.panterlinkissue23247 messages
2015-01-16 06:17:50martin.pantercreate