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

Eric Mangold teratorn at twistedmatrix.com
Sat Feb 3 20:02:38 EST 2007


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().

-- 
Eric Mangold
Twisted/Win32 Co-Maintainer




More information about the Twisted-Python mailing list