Message302146
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... |
|
Date |
User |
Action |
Args |
2017-09-14 06:42:06 | Leonardo Francalanci | set | recipients:
+ Leonardo Francalanci, r.david.murray, martin.panter, eryksun |
2017-09-14 06:42:06 | Leonardo Francalanci | set | messageid: <1505371326.61.0.585034273953.issue31447@psf.upfronthosting.co.za> |
2017-09-14 06:42:06 | Leonardo Francalanci | link | issue31447 messages |
2017-09-14 06:42:06 | Leonardo Francalanci | create | |
|