no cleanup on TERM signal

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Fri May 2 02:48:06 EDT 2008


On Fri, 02 May 2008 04:36:06 +0000, Yves Dorfsman wrote:

> x.del() gets executed if:
> -I del x, then run gc.collect()
> -simply exit the script
> -get the script to abort on an exception
> 
> But if I kill it with the default signal TERM, the script dies, but I don't 
> get the message, so I am assuming that python isn't taking the time to 
> cleanup, even though that is (was) what TERM was intended for.
> 
> Has this been discussed before ? Is worth a suggestion (PEP) ?

There is the docs for `__del__()` saying this method is not guaranteed to
be called at all.  Don't use it if you *need* that method to be called. 
Just like `finalize()` in Java, it can't be used for deterministic
destruction, so it's not that useful after all.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list