When using subprocess.Popen
(or something which is using Popen
internally and forwarding all parameters like check_output
) to start a process where the output, I would've let stdout
and stderr
point to /dev/null
(or the Windows equivalent) as described in How to hide output of subprocess in Python 2.7.
Now I just came across a big Python project where both these parameters were simply set to PIPE
. This seems to be no problem here because there is need to wait for the end of the process and in fact the process is always running until it's killed by the Python program (i.e. no .wait()/.poll()/.communicate()
call).
Now I wonder if that's a good idea and what is happening under the hood. A pipe is opened but nobody is reading from it and therefore nothing is written there (though non-blocking I guess)? Or a pipe is opened and the process is writing there and it's filling up some memory location?
Most importantly: Is this a good idea?