This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients eamanu, p-ganssle, vstinner, xtreak
Date 2019-02-12.10:55:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1549968912.91.0.126725166471.issue35969@roundup.psfhosted.org>
In-reply-to
Content
Last year, I reworked Python initialization to introduce a new _PyInitError structure which allows to report a failure to the caller of a function instead of calling directly Py_FatalError() which always call abort() immediately.

_PyInitError allows to distinguish "user error" and "internal error". User error is caused by an user mistake, whereas internal errors are all other errors. User errors don't call abort() to avoid dumping a core dump.

It's not always easy to decide if a bug is caused by the user or not.

For example, a memory allocation failure is now considered as an "user error":

#define _Py_INIT_NO_MEMORY() _Py_INIT_USER_ERR("memory allocation failed")

See Include/coreconfig.h for the definition of _PyInitError and related macros.

One enhancement of this new API is that it now reports the name of the C function which causes the error. The initial bug report says "Fatal Python error: init_sys_streams: can't initialize sys standard 
streams": init_sys_streams() function raised the fatal error.
History
Date User Action Args
2019-02-12 10:55:12vstinnersetrecipients: + vstinner, p-ganssle, eamanu, xtreak
2019-02-12 10:55:12vstinnersetmessageid: <1549968912.91.0.126725166471.issue35969@roundup.psfhosted.org>
2019-02-12 10:55:12vstinnerlinkissue35969 messages
2019-02-12 10:55:12vstinnercreate