[issue23571] Raise SystemError if a function returns a result with an exception set

STINNER Victor report at bugs.python.org
Sat Mar 21 20:24:05 CET 2015


STINNER Victor added the comment:

Le 21 mars 2015 18:05, "Serhiy Storchaka" <report at bugs.python.org> a écrit :
> But an assertion itself provides less information than an exception.
Debug build is less informative than release build.

I like Antoine's idea to replace the assertion with Py_FatalError() in
debug mode.

I'm more concerned by bugs in Python itself. A fatal error/assertion should
be noticed quickly on buildbots which compile python in debug mode.

It's just fine if other people use the release mode and get an exception.

> May be add a runtime flag to control the reaction on system errors? If it
set, all raised SystemError will be converted to fatal errors.

It's already what I do when running Python test suite with pyfailmalloc. I
modify manually SystemError constructor in the C code. A flag may help, but
you have to know that many tests expect SystemError (I don't remember which
ones).

Victor

----------

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


More information about the Python-bugs-list mailing list