Skip to content

Commit

Permalink
flux-jobs: force default stdout encoding to utf-8
Browse files Browse the repository at this point in the history
Problem: Python3 doesn't work well in non UTF-8 clean locales
such as C/POSIX. This will be especially true when RFC19 F58
encoded JOBIDs are supported in flux-jobs.

Force stdout to UTF-8 encoding in flux-jobs. This is only necessary
in python 3.6 since UTF-8 seems to be the default in 3.7 and
above.
  • Loading branch information
grondo committed Jul 14, 2020
1 parent a85e992 commit 7803e31
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cmd/flux-jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,9 @@ def color_reset(color_set):

@flux.util.CLIMain(LOGGER)
def main():

sys.stdout = open(sys.stdout.fileno(), "w", encoding="utf8")

args = parse_args()

if args.jobids and args.filtered:
Expand Down

0 comments on commit 7803e31

Please sign in to comment.