Message389571
Python works as expected: the UTF-8 codec doesn't allow to encode surrogate characters.
Surrogate characters are coming from os.environ['a'] because this environment variable contains bytes which cannot be decoded from the sys.getfilesystemencoding().
You should fix your system setup, especially the locale encoding. The strings stored in the "a" environment variable was not encoded to the Python filesystem encoding:
https://docs.python.org/dev/glossary.html#term-filesystem-encoding-and-error-handler
If you are lost with locale encodings, you can attempt to encode everything in UTF-8 and enables the Python UTF-8 Mode:
https://docs.python.org/dev/library/os.html#python-utf-8-mode
Good luck with your setup ;-)
Hint: use print(ascii(job_name)) to dump the string content. |
|
Date |
User |
Action |
Args |
2021-03-26 23:12:04 | vstinner | set | recipients:
+ vstinner, terry.reedy, ezio.melotti, eryksun, rushant |
2021-03-26 23:12:04 | vstinner | set | messageid: <1616800324.51.0.386656629734.issue43576@roundup.psfhosted.org> |
2021-03-26 23:12:04 | vstinner | link | issue43576 messages |
2021-03-26 23:12:04 | vstinner | create | |
|