Message335294
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. |
|
Date |
User |
Action |
Args |
2019-02-12 10:55:12 | vstinner | set | recipients:
+ vstinner, p-ganssle, eamanu, xtreak |
2019-02-12 10:55:12 | vstinner | set | messageid: <1549968912.91.0.126725166471.issue35969@roundup.psfhosted.org> |
2019-02-12 10:55:12 | vstinner | link | issue35969 messages |
2019-02-12 10:55:12 | vstinner | create | |
|