[Twisted-Python] Reactor getting stuck in random places on Windows?

Steve Freitas sflist at ihonk.com
Sat Feb 3 22:05:53 EST 2007


On Sat, 2007-02-03 at 19:02 -0600, Eric Mangold wrote:
> On Sat, 03 Feb 2007 13:46:11 -0600, Steve Freitas <sflist at ihonk.com> wrote:
> [...]
> > In related news, I've decided to go back to trying to make
> > spawnProcess() work for me. I didn't realize it at the time, but when I
> > do subProcess.Popen(shell=True), although it solved my open console
> > window problem, it spawned my desired process as a child to a CMD.EXE
> > process. I didn't think that was a big deal until I figured out how hard
> > it is under Windows without using either the Taskkill utility (and I
> > need to run on Win98) or undocumented calls (e.g. Sysinternals) to kill
> > a child process while being absolutely certain that's the process you
> > want to kill.
> >
> > I'm going to have multiple instances of this process, so I
> > can't kill by name, and I don't want to kill by PID, because it could
> > get reused. I'd love to be corrected here if I'm wrong, by the way.
> 
> There really isn't any room for error if you just save the handle that was  
> returned when you spawned the process. Just use that in a call to  
> TerminateProcess().

Yeah, that's another thing that drove me back to spawnProcess(). With
subprocess.Popen, I have to use shell=True to keep the terminal window
hidden, and then I don't have the handle (or even the PID obtained
directly) of the process that gets launched as a child of CMD.EXE, so
I'm stuck with a little uncertainty when I try to kill the process.

Steve





More information about the Twisted-Python mailing list