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

2022-03-11 Thread Eryk Sun
Change by Eryk Sun : -- superseder: -> Encoding error running in subprocess with captured output ___ Python tracker ___ ___ Python-

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

2022-03-11 Thread markhuang3310
Change by markhuang3310 : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Uns

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

2022-03-11 Thread markhuang3310
markhuang3310 added the comment: sorry, I found the duplication https://bugs.python.org/issue34618 -- resolution: -> duplicate ___ Python tracker ___

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

2022-03-11 Thread markhuang3310
markhuang3310 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 "", line 1, in \r\n File "C:\\Python36\\lib\\encodings\\cp1252.py", line 19, in encode\r\nreturn codecs.charmap_encode(input,self.errors,enc

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

2022-03-11 Thread markhuang3310
New submission from markhuang3310 : Env: Windows 10 Python3.8.10 amd64 Desciption: I try to get output from a python program with a subprocess. The python program print a unicode character. ``` import subprocess import sys cmd = rf'''{sys.executable} -c "print('\u042f')"''' print('case 1') st