fix(gateway): add encoding=utf-8, errors=replace to subprocess calls on Windows - #52846
Closed
ethanhuang996-alt wants to merge 4 commits into
Closed
fix(gateway): add encoding=utf-8, errors=replace to subprocess calls on Windows#52846ethanhuang996-alt wants to merge 4 commits into
ethanhuang996-alt wants to merge 4 commits into
Conversation
…— prevent GBK crash on Windows Chinese locale
ethanhuang996-alt
force-pushed
the
fix/gbk-encoding-crash
branch
from
June 26, 2026 04:23
4c747d8 to
ef84eed
Compare
13 tasks
Contributor
|
Closing as superseded by the consolidated Windows console-flash work tracked in #54220. The relevant pieces from this PR/cluster have now landed through the targeted follow-up PRs #54236, #53892, and #54417, or are recorded in the umbrella tracker for any remaining native-Windows verification. Keeping this separate PR open would duplicate the tracker and the merged follow-up work. Thanks for digging into this — the reports and PRs in this cluster helped identify the remaining spawn legs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Windows Chinese locale (GBK/CP936), subprocess.Popen/run(text=True) defaults to GBK encoding. When a subprocess outputs UTF-8 Chinese characters, the internal _readerthread crashes.
This causes: output pipe stalls, event loop blocked, WebSocket write timeout, window freezes, gateway restarts. errors.log showed 1,830 identical crash entries.
Fix
Add encoding=utf-8, errors=replace to 5 subprocess calls in:
Verification