SIGTERM handling

Manlio Perillo manlio_perilloNO at SPAMlibero.it
Fri May 5 11:30:20 CEST 2006


Hi.

I have tried this script:

from ctypes import cdll, c_int
from signal import SIGTERM, SIGINT
from time import sleep


msvcrt = cdll.LoadLibrary("MSVCR71") # is this the lib to use?
sig = c_int(SIGTERM)
raise_ = getattr(msvcrt, "raise")
raise_(sig)
sleep(10)


The problem is that SIGTERM causes the program to exit (without calling
atexit registered functions).

Why?
In the MSDN documentations it is written that SIGTERM is by default
ignored and in the Python documentation for signal module it is written
that there should be no handler for SIGTERM.



Thanks  Manlio Perillo



More information about the Python-list mailing list