Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #2714

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

References <4D9523EF0200001B00016CE4@smtp.nfra.nl> <AANLkTin+sKL_-JaTeTRGpHsGKC2ERukEM+VsqMqOG-8X@mail.gmail.com> <4D9C36A90200001B00002FFE@smtp.nfra.nl>
Date 2011-04-06 10:43 -0700
Subject Re: Behaviour of subprocess.Popen, ssh and nohup I don't understand
From Dan Stromberg <drsalists@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.82.1302111802.9059.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Apr 6, 2011 at 12:47 AM, Adriaan Renting <renting@astron.nl> 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.
>
> Thank you for your help.
>
> Adriaan Renting.
> --
> http://mail.python.org/mailman/listinfo/python-list

http://docs.python.org/library/subprocess.html
"With None, no redirection will occur; the child’s file handles will
be inherited from the parent."

When a background process reads from a tty (which is most likely what
its inherited stdin is connected to), it gets a SIGTTIN, suspending
your background process.

See also "ssh -n".

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Behaviour of subprocess.Popen, ssh and nohup I don't understand Dan Stromberg <drsalists@gmail.com> - 2011-04-06 10:43 -0700

csiph-web