Django Keyboard Interrupt
I run my django project with Apache, mod_fastcgi and django.core.servers.fastcgi.runfastcgi. I receive mail about all exceptions.
There is one exception I don't know what to do with. It's KeyboardInterrupt. It occurs at different places of my code. Why does it occur? There is no keyboa开发者_Go百科rd in Apache!
The exception KeyboardInterrupt is raised when the python process receives a SIGINT signal. Normally, this happens if one types Control-C in a shell (therefore the name), but can also be done programmatically. However, I can't tell you under which circumstances Apache or mod_fastcgi might send this signal. In multi-threaded applications, KeyboardInterrupt may also be raised by subthreads to interrupt the main thread (via thread.interrupt_main()).
精彩评论