Rich Python Console Package Solution. Potential pyox bug.

45 views
Skip to first unread message

Ty

unread,
Jul 1, 2022, 7:21:02 AM7/1/22
to pyoxidizer-users
Hi All,

If you are using the (excellent) rich console formatting library and rich throws UnicodeEncodeError exceptions, put either (or perhaps both) of the following lines in your make_exe() function:

    python_config.utf8_mode = -1
    python_config.stdio_encoding = "UTF-8"

These config settings are the defaults for the CPython interpreter so I was surprised to find that this was not the case for the pyoxidizer interpretter. Could this be a bug?

I haven't encountered other discussions of this issue so I hope this helps someone!

rich exception:
```UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-75: ordinal not in range(128) *** You may need to add PYTHONIOENCODING=utf-8 to your environment ***```


Reply all
Reply to author
Forward
0 new messages