Alexander Southgate wrote:
> After a bit of searching we came across Fazal Majid's useful
> extension, threadframe
> which exports thread stack frames as a dict.
> If you've used Java much you know that sending SIGQUIT to a Java
> process will dump all thread stack frames to stderr. We wanted to
> mimic this behavior in Python and so patched the ThreadedAppServer
> class to catch SIGQUIT, dump threads to stdout, and continue on its
> merry way.
> Attached is the patch to Webware 0.9.1's ThreadedAppServer. Obviously
> it requires the alpha/beta (but seemingly stable) threadframe package,
> so caveat emptor, etc. etc.
I think that is very useful and I have applied your patch to the current
trunk. One thing I changed is that the signal handler is only installed
if the threadframe module is installed (otherwise, you'll get the
I also made this work on Windows by using SIGBREAK here. So on Windows,
you can shutdown/restart with Ctrl-C and you can now get a thread dump
However, I have one problem under Windows: Hitting Ctrl-Break does only
work one time. For some reason, Windows ignores subsequent Ctrl-Breaks.
Does anybody have an explanation for that behavior?