You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Decode Child Output as UTF-8 in the Test That Fails on Windows' Code Page #2946
gateA rule with no mechanical check, or a check that misses a shapepre-existingReview finding classed pre-existing per local-strict-review Disposing of Findings
The Windows unit test job logs an unhandled exception in a subprocess reader thread on every run, on develop as well as on feature branches:
File "...\Lib\subprocess.py", line 1615, in _readerthread
buffer.append(fh.read())
File "...\Lib\encodings\cp1252.py", line 23, in decode
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 1: character maps to <undefined>
Some test runs a child with text=True (or universal_newlines=True) and no encoding=, so on Windows Python decodes the child's output with the ANSI code page. A child that prints UTF-8 (byte 0x8d is a UTF-8 continuation byte) then fails to decode. The exception is raised in the reader thread, so the suite still reports OK. The child's output is lost, though, and any assertion on it reads an empty string, which can turn a check into a false green.
It appears in the log after the carry tests' output and before the next block of dots, so it is likely one of the subprocess.run(..., text=True) calls under tests/ that omits encoding="utf-8".
Fix: find the call (running the Windows leg with -v names the test) and pass encoding="utf-8", with errors="replace" where the output is only read for an assertion message.
Found while driving #2944, which does not touch the affected test.
gateA rule with no mechanical check, or a check that misses a shapepre-existingReview finding classed pre-existing per local-strict-review Disposing of Findings
Activity
Tighten the CLI Usage Gate, Share Its Status Parser, and Fix the Wind…