fix(whatsapp): tolerate localized Windows netstat and taskkill output - #63628
fix(whatsapp): tolerate localized Windows netstat and taskkill output#63628LceAn wants to merge 1 commit into
Conversation
|
Pinging for a review — happy to reword or split if it helps. Worth flagging that this one fixes a functional failure, not just test noise: on Chinese Windows the It also turns This is the |
|
Nice pin, @LceAn — the One sibling in the same file this PR doesn't cover, same GBK class: Two things make it a touch hotter than the netstat site:
(The inner Same one-line remedy — |
|
Thanks for isolating a real Windows cleanup failure. Current main still has the reported Problems
Suggested changes
Automated hermes-sweeper review. |
3d999bd to
dbc512f
Compare
Related to #63223: the live diff now covers both the netstat and taskkill Windows text-decoding sites and includes an exact kwargs test. This is related repair work, not a duplicate. |
|
Updated per review. Added Focused validation: the two mock tests plus the native-listener regression all pass (3 passed). The canonical two-file run is currently blocked at collection by the existing Windows clean-env HOME/USERPROFILE issue, before these tests execute; the direct focused run passes. |
dbc512f to
c211080
Compare
|
Maintenance update: rebased onto current |
Decode both Windows netstat and taskkill text output with errors="replace" so localized bytes cannot abort stale-port cleanup or bridge teardown. Add stable mock assertions for the netstat decoding policy and update the exact taskkill expectation. Addresses review feedback on NousResearch#63628.
c211080 to
d2563f0
Compare
|
Second-pass maintenance: retained the minimal |
|
Closing as superseded: both production hunks are strictly subsumed by the |
What & why
On Windows,
netstatandtaskkillcan emit localized text using the active code page. Withtext=Trueand a UTF-8-forced process environment, Python may raiseUnicodeDecodeErrorbefore the WhatsApp bridge cleanup output is parsed. The outer cleanup guard can then silently leave a stale bridge process or port behind.Change
errors="replace"to the Windowsnetstatcall in_kill_port_process().taskkillcall in_terminate_bridge_process().Replacing undecodable status text is safe here: the parser only consumes ASCII port/state/PID tokens, and taskkill output is diagnostic.
Validation
ruffandgit diff --checkpass.Related #63223 work is complementary rather than duplicate.