[issue30817] Abort in PyErr_PrintEx() when no memory

Xavier de Gaye report at bugs.python.org
Sat Jul 1 15:58:34 EDT 2017


Xavier de Gaye added the comment:

There are just 6 cases left where the return code of _PySys_SetObjectId() is ignored:

Python/pylifecycle.c|689 col 5| _PySys_SetObjectId(&PyId_stderr, pstderr);
Python/pylifecycle.c|1211 col 9| _PySys_SetObjectId(&PyId_stderr, pstderr);
Python/pylifecycle.c|1657 col 5| _PySys_SetObjectId(&PyId_stdin, std);
Python/pylifecycle.c|1666 col 5| _PySys_SetObjectId(&PyId_stdout, std);
./Python/pythonrun.c|104 col 9| _PySys_SetObjectId(&PyId_ps1, v = PyUnicode_FromString(">>> "));
./Python/pythonrun.c|109 col 9| _PySys_SetObjectId(&PyId_ps2, v = PyUnicode_FromString("... "));

Error should be handled there in the same way errors are handled within the functions where they are invoked (returning -1, NULL or aborting). This should be the purpose of another issue as it is acceptable I think that there is no test case for those changes.

I am leaving the day after tomorrow for few weeks, without internet access (sailing to the mid-atlantic), and will create then a new issue if no one else does that first.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30817>
_______________________________________


More information about the Python-bugs-list mailing list