Message140864
I hit a variant of issue #12251, namely when you redirect both stdout and stderr of a child process and one of them uses a low fd.
Testcase:
import subprocess, sys
subprocess.call(["ls", "asda"], stderr = sys.stdout, stdout = open("/dev/null", "w"))
strace output:
open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
[child process]
dup2(3, 1) = 1 // overwrites the stdout filedescriptor..
dup2(1, 2) = 2 // that was supposed to be duped here.
close(3) = 0 // okay
The testcase is supposed to print "ls: file not found" on stdout, but is silent. |
|
Date |
User |
Action |
Args |
2011-07-22 09:46:25 | chn | set | recipients:
+ chn, vstinner, r.david.murray, neologix, socketpair, alexey-smirnov, Evgeny.Tarasov |
2011-07-22 09:46:25 | chn | set | messageid: <1311327985.38.0.34086664076.issue12607@psf.upfronthosting.co.za> |
2011-07-22 09:46:24 | chn | link | issue12607 messages |
2011-07-22 09:46:23 | chn | create | |
|