I need to run a program and gather its output to stdout. This program (socat) needs to run in the background for the duration of the python script. Socat sits in dameon mode
If you supply it with a pipe for stdout and stderr, I think the subprocess will block waiting for the pipes to be read. .read() should read to EOF, I think. Between them, those two issues prolly makes a deadlock.
However, I think that since .read() will read till EOF, it will block even if there is no stderr pipe.
You want to stick the reading in a thread, I think.