[Python-Dev] Issue #8863 adds a new PYTHONNOFAULTHANDLER environment variable

Antoine Pitrou solipsis at pitrou.net
Sat Dec 18 18:50:03 CET 2010


On Sat, 18 Dec 2010 17:50:38 +0100
Georg Brandl <g.brandl at gmx.net> wrote:
> Am 18.12.2010 14:57, schrieb Victor Stinner:
> > Le 18/12/2010 13:21, Georg Brandl a écrit :
> >> I very much like having a traceback on (some) segmentation faults,
> > Why do you say "some" segmentation faults?
> >> but it's clear there needs to be a way to turn it off.  An environment variable
> >> seems to be the obvious choice (for the reasons you stated for
> >> PYTHONDONTWRITEBYTECODE).
> > Amaury proposed a new function sys.setsegfaultenabled(). Such function 
> > can be used in a customized site module. I think that I will implement 
> > it in my next patch, before commiting the new feature. I suppose that we 
> > also need a function to get the status of the fault handler.
> > 
> > I just don't like the name. I would prefer sys.setfaulthandlerenabled(), 
> > I maybe just sys.setfaulthandler(). As this feature is specific to 
> > CPython, should it be protected function? So:
> >   * sys._setfaulthandler(bool): enable/disable the fault handler
> >   * sys._getfaulthandler()->bool: get the status (enabled/disabled) of 
> > the fault handler
> 
> In any case, this is coming pretty late; beta 2 is scheduled for this
> weekend, and even if this is something that only kicks in when all hope
> is lost anyway, it is a new feature.  I should like to hear approval
> from a few more devs before I will let this go into 3.2.

I'm +1 on Victor's patch, although I don't think the sys function is
useful at all. The env var is enough IMO.
(I would even be for backporting it to the bugfix branches if there's
no downside)

Regards

Antoine.




More information about the Python-Dev mailing list