Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Lib/test/test_codecencodings_jp.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,15 @@ class Test_SJISX0213(multibytecodec_support.TestBase, unittest.TestCase):
b"\x85Gℜ\x85Q = ⟨ሴ⟩"
)


class Test_iso2022_jp_2004(unittest.TestCase):
def test_gh101180(self):
import codecs
crashfile_txt = b'8N=d\xcf\x844\x11\x1b\x1b\x0b\x1b\x1b\x1b\x1b\x1b\x1b\x1b\x1b_\x0b\x0b]*\xca\x8c\x01\x00\x00P\x1bK\xf1\x94\xa1\x96'
text = crashfile_txt.decode('utf-8')
# This would trigger a crash or ASAN failure per the original report.
codecs.encode(text, encoding='iso2022_jp_2004', errors='ignore')


if __name__ == "__main__":
unittest.main()