fix(windows): add OSError to os.kill and UTF-8 encoding to file reads (supersedes #13587)#17250
fix(windows): add OSError to os.kill and UTF-8 encoding to file reads (supersedes #13587)#17250zhanggttry wants to merge 0 commit into
Conversation
Merge Conflict StatusThis PR has merge conflicts because the fork ( Plan to resolveI will rebase this PR on top of the latest AlternativeIf a maintainer prefers, I can close this PR and open a fresh one based on the current cc @alt-glitch (noted the duplicate concern on #17262) |
4990e60 to
fbffddb
Compare
CI Analysis (rebased onto latest main)After rebasing onto the latest main, the key lint checks now pass: ✅ ruff + ty diff — PASS (previously failed due to Pre-existing failures (not caused by this PR)The remaining CI failures are pre-existing issues on the main branch, not caused by this PR's changes:
This PR only changes |
✅ CI Analysis — All failures are pre-existing on mainAfter rebasing onto the latest
Test & e2e failures are identical to mainI compared the failing tests on this PR with the latest
None of these failures are related to this PR's changes — they are all pre-existing issues on This PR only changes |
CI Status UpdateI have synced this branch with the latest Passing (6/9): uv.lock check, Lint (ruff + ty), Nix, OSV-Scanner, Docs Site Checks, Docker Build Failing (3/9):
Summary: No action needed on my end. The actual code change is clean — only |
f75efc5 to
0243184
Compare
9f48c94 to
3034eee
Compare
Summary
Replaces #13587 with a zero-ctypes approach that passes Supply Chain Audit.
Problem
On Windows:
os.kill(pid, 0) for process-existence checks raises OSError (errno 87) instead of ProcessLookupError when the PID does not exist. Existing code only caught ProcessLookupError, causing unhandled exceptions on Windows.
Path.read_text() and open(..., "r") default to the system ANSI encoding (e.g. GBK on Chinese Windows). Reading files containing non-ASCII characters (skill manifests, config YAML, etc.) raises UnicodeDecodeError.
Solution
OSErrorto everyos.killexcept clause.encoding="utf-8"to all file reads (Path.read_text, open, json.loads from file).Files Modified
Safety
Related Issues