[Python-Dev] Integrate the faulthandler module into Python 3.3?

Victor Stinner victor.stinner at haypocalc.com
Fri Mar 4 14:26:16 CET 2011


Le vendredi 04 mars 2011 à 15:05 +0200, Simon Cross a écrit :
> While I like this module I'm against it going into the standard
> library so soon. Modules need time to mature, develop and gain wide
> adoption outside the standard library where they are less constrained
> by maintaining compatibility with old versions and can enjoy shorter
> release cycles.
> 
> There may be reasons for including a shiny new module in the standard
> library despite the drawbacks (the rest of the standard library might
> wish to use the new feature, for example). If there are such reasons
> it would be nice to see them stated and discussed here.

faulthandler is not so new. I am working on it since september 2008
(issue #3999). It was first an hack to convert a SIGSEGV into a classic
Python exception. I started a reimplementation to just display the
backtrace in may 2010, and I wrote 11 versions to fix all remarks. But
ok, the module itself was created at christmas 2010. Before the
conversion of the patch to module, there was very few options. With the
module, I added new functions with more options.

The module is also small: it has 8 functions (+ 4 functions dedicated to
tests).

faulthandler is also a little bit special, because it is very specific
to CPython: it is based on CPython internal structures. Integrate it
directly into Python would simplify its maintenance, but it would also
help to add more hooks like dumping the backtrace at a fatal error, and
maybe have a finer control on the module (eg. handle child processes
correctly?). (Well, there is a recent addition to Python 3.2 to choose
the function used to display the fatal error message, but I didn't tried
it yet).

Victor



More information about the Python-Dev mailing list