Author Leonardo Francalanci
Recipients Leonardo Francalanci, eryksun, martin.panter, r.david.murray
Date 2017-09-14.06:42:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1505371326.61.0.585034273953.issue31447@psf.upfronthosting.co.za>
In-reply-to
Content
I have a workaround, and I guess this means there's a bug in the current implementation of stdout/stderr=subprocess.PIPE; if I open my own pipes instead of using subprocess.PIPE everything seems to work (provided I close the pipe before reading from it):

(errPipeR, errPipeW) = os.pipe();
(outPipeR, outPipeW) = os.pipe();

proc = subprocess.Popen(proc_str,
                                    stdin=subprocess.PIPE,
                                    stderr=errPipeW,
                                    stdout=outPipeW,shell=False,
                                    universal_newlines=True)

proc.communicate(timeout=20)
os.close(outPipeW)
os.close(errPipeW)

Now I can read from the "R" pipes with 0 problems (getting the error and output streams), and proc.communicate exits as soon as the called process exits (4 seconds).

So, since I can use my own pipes without any problems, I don't see why the regular "subprocess.PIPE" shouldn't be working...
History
Date User Action Args
2017-09-14 06:42:06Leonardo Francalancisetrecipients: + Leonardo Francalanci, r.david.murray, martin.panter, eryksun
2017-09-14 06:42:06Leonardo Francalancisetmessageid: <1505371326.61.0.585034273953.issue31447@psf.upfronthosting.co.za>
2017-09-14 06:42:06Leonardo Francalancilinkissue31447 messages
2017-09-14 06:42:06Leonardo Francalancicreate