Commit 16aac12
committed
[serial-console] Fix garbled console output by decoding binary websocket frames
The serial-console extension's on_message callback assumed websocket
frames were always str. Newer versions of websocket-client (>= 1.0)
return bytes for binary frames, which the extension passed straight
into print() and got rendered as a Python bytes repr (b'...\r\n
\x1b[0;32m...'). This makes the serial console unusable on recent
Python/websocket-client combinations (reproduced on Python 3.13 with
the vendored websocket-client 1.3.1).
Decode bytes to str inside on_message so that ANSI escapes and CR/LF
are interpreted by the user's terminal as intended.
Bumps version to 1.0.0b4 and adds a HISTORY.rst entry.
Fixes #9796
Made-with: Cursor1 parent ff6e40b commit 16aac12
3 files changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
3 | 7 | | |
4 | 8 | | |
5 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
435 | 440 | | |
436 | 441 | | |
437 | 442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
0 commit comments