Commit 21126a3
committed
python: fix handling of base64 output in JobWatcher
Problem: If there is binary output, encoded in base64 in the job
output eventlog, the JobWatcher class and thus flux-watch(1) throws
errors about bytes not being encodable as JSON.
First, ensure that base64 encoded output is decoded to utf-8 with
surrogates, so that the data can be encoded back to binary without
data loss.
Then, in the JobWatcher class, ensure all output streams are capable
of handling the surrogates (and utf-8) by reconfiguring them (in
python 3.7+) or reopening them with the proper error handling.
Fixes #57021 parent 8d24e94 commit 21126a3
2 files changed
+23
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
117 | 119 | | |
118 | 120 | | |
119 | 121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
371 | | - | |
| 370 | + | |
| 371 | + | |
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
382 | 398 | | |
383 | 399 | | |
384 | 400 | | |
| |||
420 | 436 | | |
421 | 437 | | |
422 | 438 | | |
423 | | - | |
| 439 | + | |
424 | 440 | | |
425 | | - | |
| 441 | + | |
426 | 442 | | |
427 | 443 | | |
428 | 444 | | |
| |||
0 commit comments