Skip to content

fix: keep the Windows launcher alive when stdout is cp1252 - #30

Draft
feizheng10 wants to merge 1 commit into
amd:mainfrom
feizheng10:fix/windows-stdio-encoding
Draft

feizheng10 wants to merge 1 commit into
amd:mainfrom
feizheng10:fix/windows-stdio-encoding

Conversation

@feizheng10

Copy link
Copy Markdown

Summary

The kernel-bottleneck Windows behavioral job on amd/skills#285 crashed in the skillscope launcher (bootstrap/launch.py, main, sys.stdout.write). The console encoding is cp1252, and child output decoded with errors="replace" can contain U+FFFD. Writing that character raised UnicodeEncodeError: 'charmap' codec can't encode character '\ufffd' and aborted the action.

At process startup the launcher now reconfigures sys.stdout and sys.stderr to UTF-8 with errors="replace" when the streams support reconfigure. A missing stream, a redirect that cannot be reconfigured, or an OSError / ValueError does not crash startup. Eval logic, skill content, runner selection, and rocprof-compute behavior are unchanged.

Test plan

  • python -m unittest tests.test_skillscope.TestActionLauncher — relaying U+FFFD through a cp1252-like stdout does not raise UnicodeEncodeError, and setup survives a missing, closed, or non-reconfigurable stream
  • python -m unittest discover -s tests -t . — 507 tests, OK
  • Re-run the Windows kernel-bottleneck behavioral job (Federate the six rocprof-compute skills skills#285) and confirm the launcher stays up when a line contains U+FFFD

Made with Cursor

GitHub Actions Windows runners encode the console as cp1252. Child output is decoded with errors=replace, so a relayed line can contain U+FFFD, and writing that character aborts the action with UnicodeEncodeError.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant