Closed o3bvv closed 8 years ago
Thanks for the report. This is intended behaviour: by default, stdout
is treated as a raw byte stream. The encoding
argument claims to change the captured output:
encoding
-- if set, this is used to decode any output. By default, any output is treated as raw bytes. If set, the raw bytes are decoded before writing to the passedstdout
andstderr
arguments (if set) and before setting the output attributes on the result.
However, from a quick look at the source code, I suspect I erred and this is only happening to the output attributes on the result. The code you've suggested doesn't work since it'll fail when the output is the first byte of a multi-byte character.
0.3.17 should now behave as the documentation describes with respect to the encoding
argument.
The code I've suggested was not to fix the error, but just to point where it is happening.
Nevertheless, thanks for your answer!
Hi,
if you use
stdout=sys.stdout
while running command using Python 3, you will get such error:To fix this, you need to decode child's output at
io._ContinuousReader._capture_output():82
:Thanks.