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

Steve Freitas sflist at ihonk.com
Sat Feb 3 14:46:11 EST 2007

Thanks for your response, gives me a bunch to think about.

On Sat, 2007-02-03 at 09:10 -0600, Eric Mangold wrote:
> As for why your process is hanging in the first place, who is to say?  
> Maybe try running under WingIDE (or something) and break in w/ the  
> debugger when things hang up. The stack trace ought to give you some clues.

Great idea, I'll give it a go.

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.

So back it is to spawnProcess(), since it gives me a ProcessProtocol I
can call transport.loseConnection() on to kill exactly what I mean to
kill. To solve the console problem, I'm going to try Igor Kravtchenko's
modified spawnProcess[1], and pass in CREATE_NO_WINDOW or
DETACHED_PROCESS to see what happens.



More information about the Twisted-Python mailing list