This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author chn
Recipients Evgeny.Tarasov, alexey-smirnov, chn, neologix, r.david.murray, socketpair, vstinner
Date 2011-07-22.09:46:23
SpamBayes Score 0.0010071916
Marked as misclassified No
Message-id <1311327985.38.0.34086664076.issue12607@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-07-22 09:46:25chnsetrecipients: + chn, vstinner, r.david.murray, neologix, socketpair, alexey-smirnov, Evgeny.Tarasov
2011-07-22 09:46:25chnsetmessageid: <1311327985.38.0.34086664076.issue12607@psf.upfronthosting.co.za>
2011-07-22 09:46:24chnlinkissue12607 messages
2011-07-22 09:46:23chncreate