[issue27035] Cannot set exit code in atexit callback

Pablo Galindo Salgado report at bugs.python.org
Tue Jan 22 17:55:33 EST 2019


Pablo Galindo Salgado <pablogsal at gmail.com> added the comment:

I think this is a documentation issue today. The docs say:

>If an exception is raised during execution of the exit handlers, a traceback
>is printed (unless SystemExit is raised) and the exception 
>information is saved. After all exit handlers have had a chance to run the
>last exception to be raised is re-raised.

Which is true except for two things:

- SystemExit is not covered by the paragraph (it just says that SystemExit will not print a traceback but what actually happens is that is ignored).
- The last exception is not re-raised (as it was on Python2.7).

I think we should update the docs to reflect that SystemExit is ignored and to remove that the last exception is re-raised.

----------
nosy: +pablogsal

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27035>
_______________________________________


More information about the Python-bugs-list mailing list