Re: Problem with subprocess.Popen and EINTR

2017-10-29 Thread Piet van Oostrum
Cameron Simpson writes: [...] > What if you did this: > > os.signal(SIGINT, SIG_IGN) > ... code code code, including the Popen/wait ... > old_handler = os.signal(SIGINT, do_nothing_handler) > sleep(...) > os.signal(SIGINT, old_handler) > > SIG_IGN is different from a do-nothing handler; it

Re: Problem with subprocess.Popen and EINTR

2017-10-28 Thread Cameron Simpson
On 28Oct2017 23:56, Piet van Oostrum wrote: I am using Python 2.7.14 on MacOS Sierra. I have a small Python program that calls a shell script in a loop with a time.sleep() in it. The shell script is called with subprocess.Popen(), followed by a subprocess.wait(). No information is exchanged w

Re: Problem with subprocess.Popen and EINTR

2017-10-28 Thread Cameron Simpson
On 29Oct2017 10:11, Cameron Simpson wrote: It may be a bug. Or it may be a system call which cannot be meaningfulling retried. But had you considered only activating the handler around the sleep? You still need to copy with SIGINT single I infer that you send this from outside the program.

Re: Problem with subprocess.Popen and EINTR

2017-10-28 Thread Chris Angelico
On Sun, Oct 29, 2017 at 8:56 AM, Piet van Oostrum wrote: > I am using Python 2.7.14 on MacOS Sierra. > > I have a small Python program that calls a shell script in a loop with a > time.sleep() in it. > The shell script is called with subprocess.Popen(), followed by a > subprocess.wait(). > No in

Problem with subprocess.Popen and EINTR

2017-10-28 Thread Piet van Oostrum
I am using Python 2.7.14 on MacOS Sierra. I have a small Python program that calls a shell script in a loop with a time.sleep() in it. The shell script is called with subprocess.Popen(), followed by a subprocess.wait(). No information is exchanged with the shell script. Once in a while I send a

Re: Problem with subprocess.Popen wget within a thread

2008-07-07 Thread Mathieu Prevot
2008/7/6 Sebastian lunar Wiesner <[EMAIL PROTECTED]>: > Mathieu Prevot <[EMAIL PROTECTED]>: > >> it seems the script (A) finishes before the downloading ends, and the >> (B) version doesn't (wanted behavior) ... this is unexpected. What >> happens ? > > "readlines" blocks, until the pipe is closed,

Re: Problem with subprocess.Popen wget within a thread

2008-07-06 Thread Sebastian "lunar" Wiesner
Mathieu Prevot <[EMAIL PROTECTED]>: > it seems the script (A) finishes before the downloading ends, and the > (B) version doesn't (wanted behavior) ... this is unexpected. What > happens ? "readlines" blocks, until the pipe is closed, which usually happens, if the process dies. On the other ha

Problem with subprocess.Popen wget within a thread

2008-07-06 Thread Mathieu Prevot
Hi it seems the script (A) finishes before the downloading ends, and the (B) version doesn't (wanted behavior) ... this is unexpected. What happens ? (A) class vid(threading.Thread): def __init__(self): threading.Thread.__init_

Re: Problem with subprocess.Popen()

2007-08-01 Thread O.R.Senthil Kumaran
> I'm trying to run a windows batch file from a python script using > subprocess.popen(). > > The issue that I'm facing is that, if i give the batch file as > parameter to the popen function, the script runs, but if i provide a > parameter, it is not working. > > The actual windows command to be

Problem with subprocess.Popen()

2007-08-01 Thread The Cruisemaniac
Hi all, I'm trying to run a windows batch file from a python script using subprocess.popen(). The issue that I'm facing is that, if i give the batch file as parameter to the popen function, the script runs, but if i provide a parameter, it is not working. Can someone help me with the command. T