Commit 973fa0e
committed
serial-console: decode binary WebSocket frames before printing
websocket-client delivers binary frames as Python bytes objects.
Passing bytes directly to PC.print() causes print() to render them
as raw repr strings (e.g. b'\r\r\n', b'login: ') instead of decoded
text, which corrupts the serial console output in WSL and other
non-Windows environments.
Fix this by decoding bytes to str with UTF-8 (replacing invalid
sequences) in on_message() before calling PC.print().
Fixes: Azure/azure-cli#33164
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: GitHub Copilot <copilot@github.com>1 parent 0f3c8a9 commit 973fa0e
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
| 441 | + | |
| 442 | + | |
441 | 443 | | |
442 | 444 | | |
443 | 445 | | |
| |||
0 commit comments