New submission from Akira Li:

The following command should not produce any output but it does:

  $ ./python >/dev/null -c 'import subprocess as S, sys; 
S.call([sys.executable, "-c", "import sys; print(42, file=sys.stderr)"], 
stderr=S.STDOUT)'

Its stdout is redirected to /dev/null. It starts a subprocess with its
stderr redirected to stdout. See "Redirect subprocess stderr to
stdout" [1] on Stackoverflow.

[1] 
http://stackoverflow.com/questions/11495783/redirect-subprocess-stderr-to-stdout

I've uploaded a patch that fixes the issue on POSIX.

Please, run the provided test (in the patch), to see whether the code
should be fixed on Windows too (it might work as is there).

No documentation changes are required.

Please, review.

----------
components: Library (Lib)
files: subprocess-stderr_redirect_with_no_stdout_redirect.diff
keywords: patch
messages: 225898
nosy: akira
priority: normal
severity: normal
status: open
title: subprocess.Popen(stderr=STDOUT) fails to redirect subprocess stderr to 
stdout
type: behavior
versions: Python 3.4
Added file: 
http://bugs.python.org/file36472/subprocess-stderr_redirect_with_no_stdout_redirect.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22274>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to