STINNER Victor <vstin...@redhat.com> added the comment:
I merged my PR #13187, so I reject PR #13175. In the python-dev thread, there is no consensus in favor of -X abortunraisable option. The few people who pronounce them on this option were more against it. https://mail.python.org/pipermail/python-dev/2019-May/157436.html At least, you can now very easily reimplement it in a few line of pure Python using the new sys.unraisablehook! For example, add this code to Lib/site.py: --- if 'abortunraisable' in sys._xoptions: import signal def abort_hook(unraisable, # keep a reference to continue to work # during Python shutdown raise_signal=signal.raise_signal, SIGABRT=signal.SIGABRT): raise_signal(SIGABRT) sys.unraisablehook = abort_hook --- Example with attached gc_callback.py: --- $ ./python -X dev gc_callback.py Exception ignored in: <function wr_callback at 0x7fa973faf870> Traceback (most recent call last): File "gc_callback.py", line 7, in wr_callback raise ValueError(42) ValueError: 42 $ ./python -X abortunraisable gc_callback.py Aborted (core dumped) $ ./python -X abortunraisable -X faulthandler gc_callback.py Fatal Python error: Aborted Current thread 0x00007fed6edc7740 (most recent call first): File "/home/vstinner/prog/python/master/Lib/site.py", line 649 in abort_hook File "gc_callback.py", line 11 in <module> Aborted (core dumped) --- ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36829> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com