gh-154863: Check the encoded bytes in the shift state flush test - #155128
Conversation
The test decoded the output back and checked the ASCII in the result, so it tested the decoder too. The ASCII is written to the output as is, so checking it there tests only the encoder. Comparing with the same text without the character also detects a character encoded as nothing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
!buildbot ARM64 MacOS M1 NoGIL |
|
🤖 New build scheduled with the buildbot fleet by @serhiy-storchaka for commit ce1e701 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F155128%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
Its iconv writes the fallback for an unencodable character at the start of the converted batch, over the ASCII already converted there. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
!buildbot ARM64 MacOS M1 NoGIL |
|
🤖 New build scheduled with the buildbot fleet by @serhiy-storchaka for commit c81bc1d 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F155128%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
|
The test decoded the output back and checked the ASCII in the result, so it tested the decoder too. On macOS 15 the round-trip of
'ABC中DEF'in ISO-2022-CN and ISO-2022-CN-EXT returns'?DEF', and the test fails on theARM64 MacOS M1 NoGIL 3.xbuildbots. macOS 13 and 26, glibc and GNU libiconv are not affected.The ASCII is written to the output as is, so checking it in the encoded bytes tests only the encoder, which is what the test is about. Comparing with the same text without the character also detects a character encoded as nothing, which neither the old nor a simpler new check would catch.
The failure message will now show the encoded bytes, so the next run on that buildbot tells whether the encoder or the decoder loses the text there.