"m.u.k" <[EMAIL PROTECTED]> wrote: > 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.
In looking at the use of Py_FatalError in the Python Sources (it's a 10 meg tarball that is well worth the download), it looks as though its use shows a Fatal error (hence the name). Things like "Inconsistant interned string state" or "Immortal interned string died" or "Can't initialize type", etc. Essentially, those errors generally signify "the internal state of python is messed up", whether that be by C extension, or even a bug in Python. The crucial observation is that many of them have ambiguous possible recoveries. How do you come back from "Can't initialize type", or even 'gc couldn't allocate "__del__"'? When you have individual solutions to some subset of the uses of Py_FatalError, then it would make sense to offer those solutions as a replacement to Py_FatalError use in those situations (also showing that the errors are not actually fatal), rather than to ask for a hook to hook all (by definition) fatal errors. - Josiah _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com