Message294560
The documentation states that subprocess.STDOUT is:
Special value that can be used as the stderr argument to Popen and indicates that standard error should go into the same handle as standard output.
However, when Popen is called with stdout=None, stderr=subprocess.STDOUT, stderr is not redirected to stdout and continues to be sent to stderr.
To reproduce the problem:
$ python >/dev/null -c 'import subprocess;\
subprocess.call(["ls", "/404"],stderr=subprocess.STDOUT)'
and observe the error message appearing on the console (assuming /404 directory does not exist).
This was reported on SO 5 years ago: https://stackoverflow.com/questions/11495783/redirect-subprocess-stderr-to-stdout.
The SO attributed this to a documentation issue, but arguably it should be considered a bug because there seems to be no reason to make subprocess.STDOUT unusable in this very common use case. |
|
Date |
User |
Action |
Args |
2017-05-26 17:42:41 | max | set | recipients:
+ max |
2017-05-26 17:42:41 | max | set | messageid: <1495820561.33.0.197241379069.issue30488@psf.upfronthosting.co.za> |
2017-05-26 17:42:41 | max | link | issue30488 messages |
2017-05-26 17:42:41 | max | create | |
|