Repository navigation
Fix UnicodeDecodeError in test_the_javascript_side_agrees under non-UTF-8 locale - #638
Conversation
Signed-off-by: rajnisht7 <rajnishtiwari9787@gmail.com>
lywinged
left a comment
There was a problem hiding this comment.
Approved. Reviewed at 2dfb0fe on da69b31. The diagnosis is right: node --test defaults to the spec reporter from Node 23, ubuntu-latest is moving to the Ubuntu 26.04 image, which carries Node 24, and the spec reporter's ✔ and ℹ are what the ASCII codec of LC_ALL=C PYTHONUTF8=0 refuses. With Node 22 given --test-reporter=spec through NODE_OPTIONS here, this test is the one failure in the root suite on main, and it passes on this head, on 3.11 and on 3.12. The measurements are on #624.
#624, which dinakarjs opened first for the same failure, made the same change to the node --test call and is merged now. This PR merges cleanly on top, and what it adds is the node --version call, which prints an ASCII version string such as v24.21.0: with that encoding removed and the other kept, the test passes under the same conditions, so it changes no outcome, and it keeps the two calls alike.
What this changes
test_the_javascript_side_agrees(tests/test_integer_by_value.py) rannode --versionandnode --testviasubprocess.run(..., text=True)with noencoding=set. Without it, Python decodes the child's stdout/stderr using the ambient locale's preferred encoding. The CI "Portability" job runs the suite underLC_ALL=C PYTHONUTF8=0, which resolves that to plain ASCII, so any non-ASCII byte in Node's output (UTF-8) crashes the decode instead of letting the test assert pass/fail normally.Type of change
Spec section
None
Tests for a fix
Checklist
git commit -s)CHANGELOG.mdupdated (for any normative change)<!-- CHANGED: #NNN: description -->in spec text