Behaviour of subprocess.Popen, ssh and nohup I don't understand

Nobody nobody at nowhere.com
Wed Apr 6 19:35:02 EDT 2011


On Wed, 06 Apr 2011 09:47:21 +0200, Adriaan Renting wrote:

> This solves the problem using stdin=open(os.devnull, 'rb') instead of
> stdin=None makes it run even if there is input from stdin in the
> foreground process.
> 
> The operating system is Ubuntu 8.04
> I understood what Suspended (tty input) means. I don't understand why
> it waits for input if stdin=None.

"None" is the default value for stdin, stdout and stderr, and means
"do nothing and allow the child process to just inherit the descriptor
from the parent". It doesn't mean "close the descriptor"; the only way
to force a descriptor to be closed in the child is to use preexec_fn= and
have the function close the descriptor.




More information about the Python-list mailing list