Message414919
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')
stdout, stderr = subprocess.Popen(cmd, stderr=subprocess.PIPE, stdout=None).communicate()
print('case 2')
stdout, stderr = subprocess.Popen(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE).communicate()
print(stderr)
```
The issue is that:
In case 1, I can see the "Я" (\u042f) form console.
In case 2, I try to get the output from subprocess.Popen(command).communicate()[0], the python process fail with UnicodeEncodeError.
Expected result:
In case2, I should get stdout == b'\u042f' |
|
Date |
User |
Action |
Args |
2022-03-11 16:41:05 | markhuang3310 | set | recipients:
+ markhuang3310, paul.moore, tim.golden, zach.ware, steve.dower |
2022-03-11 16:41:05 | markhuang3310 | set | messageid: <1647016865.89.0.743756251929.issue46988@roundup.psfhosted.org> |
2022-03-11 16:41:05 | markhuang3310 | link | issue46988 messages |
2022-03-11 16:41:05 | markhuang3310 | create | |
|