Author vstinner
Recipients ZackerySpytz, graingert, matrixise, serhiy.storchaka, vstinner
Date 2019-05-22.15:30:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1558539001.27.0.633396398882.issue36829@roundup.psfhosted.org>
In-reply-to
Content
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)
---
History
Date User Action Args
2019-05-22 15:30:01vstinnersetrecipients: + vstinner, serhiy.storchaka, graingert, matrixise, ZackerySpytz
2019-05-22 15:30:01vstinnersetmessageid: <1558539001.27.0.633396398882.issue36829@roundup.psfhosted.org>
2019-05-22 15:30:01vstinnerlinkissue36829 messages
2019-05-22 15:30:00vstinnercreate