Skip to content

Commit 4ccf427

Browse files
committed
flux-queue: reopen stdout with errors=surrogateescape encoding
Problem: When non-ascii, utf-8 characters are in output, flux-queue(1) complains about 'ascii' codec can't encode character '\u2714' in position 10 Reopen stdout with encoding="utf8", errors="surrogateescape" to avoid this encoding error.
1 parent 5d5d796 commit 4ccf427

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/cmd/flux-queue.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,10 @@ def __call__(self, parser, namespace, values, option_string=None):
429429

430430
@flux.util.CLIMain(LOGGER)
431431
def main():
432+
sys.stdout = open(
433+
sys.stdout.fileno(), "w", encoding="utf8", errors="surrogateescape"
434+
)
435+
432436
parser = argparse.ArgumentParser(prog="flux-queue")
433437
subparsers = parser.add_subparsers(
434438
title="subcommands", description="", dest="subcommand"

0 commit comments

Comments
 (0)