Message388265
communicate() is incomplete, so decoding the output may fail. For example, say the encoding is UTF-8, and the last multibyte character sequence (2-4 bytes) is incomplete. Maybe communicate() should always set `stdout_bytes` and `stderr_bytes` attributes on the timeout exception, and, in text mode, try to decode the output as `stdout` and/or `stderr`. If decoding fails, set the decoded value to None.
In Windows, run() tries to complete communication, which is dysfunctional in cases. I created bpo-43346 to propose changing the design in Windows, in order to address 3 cases that can cause subprocess.run() to ignore the given timeout. The proposed change also sets an incomplete read of stdout and stderr as bytes objects, regardless of text mode, because I was simply matching what POSIX does in this case. |
|
Date |
User |
Action |
Args |
2021-03-08 12:58:06 | eryksun | set | recipients:
+ eryksun, giampaolo.rodola, macdjord |
2021-03-08 12:58:06 | eryksun | set | messageid: <1615208286.15.0.324104399783.issue43431@roundup.psfhosted.org> |
2021-03-08 12:58:06 | eryksun | link | issue43431 messages |
2021-03-08 12:58:05 | eryksun | create | |
|