On Python 3.9, Popen passes encoding=None, not "locale", to
TextIOWrapper, so simulated_cp1252 changed nothing and the encoding
regressions could not catch a missing encoding="utf-8". The stdout
newline test used Path.write_text(newline=...), which needs 3.10.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
When --out was not given, stubgen wrote the generated code and debt lines to
sys.stdout, which translates LF to CRLF on Windows, so redirecting stdout
produced CRLF files. stdout is now reconfigured to utf-8 with LF newlines,
matching the --out path. A subprocess test checks the bytes on stdout.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V9UU71SP1UKGR51Sowbgmq