omniperf icon indicating copy to clipboard operation
omniperf copied to clipboard

investigate encoding failure

Open koomie opened this issue 3 years ago • 1 comments

Ran into this error during analyze example running on an older ubuntu 18.04 system system that had LANG=en_US by default.

--------
Analyze
--------

Created a Saved Analysis folder

--------------------------------------------------------------------------------
0. Top Stat
Traceback (most recent call last):
  File "/global/scratch/sw/omniperf/1.0.3/bin/omniperf", line 624, in <module>
    main()
  File "/global/scratch/sw/omniperf/1.0.3/bin/omniperf", line 604, in main
    omniperf_cli(args)
  File "/global/scratch/sw/omniperf/1.0.3/bin/omniperf_cli/omniperf_cli.py", line 225, in omniperf_cli
    tty.show_all(
  File "/global/scratch/sw/omniperf/1.0.3/bin/omniperf_cli/utils/tty.py", line 172, in show_all
    print(ss, file=output)
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 0-107: ordinal not in range(256)

Updating to LANG=en_US.UTF-8 fixed the issue.

We presumably always want to use utf-8 coding....

koomie avatar Nov 09 '22 22:11 koomie

Simplest solution seems to be using Python's locale module, however, it's worth noting setlocal() only sets LANG for the current process...

coleramos425 avatar Dec 06 '22 20:12 coleramos425

@koomie Closing ticket since issue is fixed. Thanks!

ppanchad-amd avatar Oct 04 '24 19:10 ppanchad-amd