[issue46988] if a python program is execute by subprocess, the python program can't output unicode characters and raise UnicodeEncodeError

markhuang3310 report at bugs.python.org
Fri Mar 11 11:43:29 EST 2022


markhuang3310 <markhuang3310 at gmail.com> added the comment:

the test output:

PS C:\case_dev> python3 .\test.py
case 1
Я
case 2
b'Traceback (most recent call last):\r\n  File "<string>", line 1, in <module>\r\n  File "C:\\Python36\\lib\\encodings\\cp1252.py", line 19, in encode\r\n    return codecs.charmap_encode(input,self.errors,encoding_table)[0]\r\nUnicodeEncodeError: \'charmap\' codec can\'t encode character \'\\u042f\' in position 0: character maps to <undefined>\r\n'

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46988>
_______________________________________


More information about the Python-bugs-list mailing list