[Python-Dev] Need to hook Py_FatalError

Guido van Rossum gvanrossum at gmail.com
Tue May 3 18:15:42 CEST 2005


> Currently Py_FatalError only dumps the error to stderr and calls abort().
> When doing quirky things with the interpreter, it's so annoying that process
> just terminates. Are there any reason why we still dont have a simple
> callback to hook Py_FatalError.
> 
> PS. If the answer is "because no one needs/implemented...", I can volunteer.

Your efforts would be better directed towards fixing the causes of the
fatal errors.

I see no need to hook Py_FatalError, but since it's open source, you
are of course free to patch your own copy if your urge is truly
irresistible. Or I guess you could run Python under supervision of gdb
and trap it that way.

But tell me, what do you want the process to do instead of
terminating? Py_FatalError is used in situations where raising an
exception is impossible or would do more harm than good.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list