Re: Using subprocess module to launch a shell shell script that itself forks a process

2008-10-09 Thread Derek Martin
On Tue, Oct 07, 2008 at 05:43:41PM -0700, Samuel A. Falvo II wrote: > p = subprocess.Popen( > command, > shell=True, > stdin=subprocess.PIPE, > stdout=subprocess.PIPE, > stderr=subprocess.STDOUT, > close_fds=True > ) > > outputChannel = p

Re: Using subprocess module to launch a shell shell script that itself forks a process

2008-10-08 Thread Gabriel Genellina
En Wed, 08 Oct 2008 15:24:39 -0300, Samuel A. Falvo II <[EMAIL PROTECTED]> escribió: On Oct 7, 6:23 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: you set stdin=PIPE - is your java process expecting some input? you're not writing anything to stdin. It does not expect input from stdin.

Re: Using subprocess module to launch a shell shell script that itself forks a process

2008-10-08 Thread Sean DiZazzo
On Oct 8, 11:24 am, "Samuel A. Falvo II" <[EMAIL PROTECTED]> wrote: > On Oct 7, 6:23 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > > Is your shell script doing something else, apart from invoking the java   > > process? > > Obviously, yes.  The script is some 150 lines long.  But the hang-

Re: Using subprocess module to launch a shell shell script that itself forks a process

2008-10-08 Thread Samuel A. Falvo II
On Oct 8, 11:31 am, "Samuel A. Falvo II" <[EMAIL PROTECTED]> wrote: > I removed the stdin=PIPE argument, and this works.  Many thanks for > bringing this to my attention. OK, I am confused. After observing a bug where the code works "every other time", like clockwork, I've used strace to figure o

Re: Using subprocess module to launch a shell shell script that itself forks a process

2008-10-08 Thread Samuel A. Falvo II
On Oct 8, 11:24 am, "Samuel A. Falvo II" <[EMAIL PROTECTED]> wrote: > It does not expect input from stdin.  However, this does not affect > any OTHER scripts or commands I run. OK, so, I'm very confused as to why this would matter. I removed the stdin=PIPE argument, and this works. Many thanks f

Re: Using subprocess module to launch a shell shell script that itself forks a process

2008-10-08 Thread Samuel A. Falvo II
On Oct 7, 6:23 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > Is your shell script doing something else, apart from invoking the java   > process? Obviously, yes. The script is some 150 lines long. But the hang-up occurs because of the forked Java process, not the other lines. > If not, y

Re: Using subprocess module to launch a shell shell script that itself forks a process

2008-10-07 Thread Gabriel Genellina
En Tue, 07 Oct 2008 21:43:41 -0300, Samuel A. Falvo II <[EMAIL PROTECTED]> escribió: I have a shell script script.sh that launches a Java process in the background using the &-operator, like so: #!/bin/bash java ... arguments here ... & In my Python code, I want to invoke this shell script

Using subprocess module to launch a shell shell script that itself forks a process

2008-10-07 Thread Samuel A. Falvo II
I have a shell script script.sh that launches a Java process in the background using the &-operator, like so: #!/bin/bash java ... arguments here ... & In my Python code, I want to invoke this shell script using the Subprocess module. Here is my code: def resultFromRunning_(command): """I