[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2021-03-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: Turns out this didn't fix all possible situations. See bpo-43406 for an updated patch. -- ___ Python tracker ___ ___

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2019-09-26 Thread Marcin Gozdalik
Marcin Gozdalik added the comment: A program which failed under Python 3.6 with TypeError: 'int' object is not callable still fails under Python 3.7.4 with same exception: import signal import os import sys import time import multiprocessing def fail(): def handler(*args): pass

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2019-05-24 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ __

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2019-05-24 Thread miss-islington
miss-islington added the comment: New changeset 310f414bbd4d6ed1d8813f724c91ce9b4129c0ba by Miss Islington (bot) in branch '3.7': bpo-23395: Fix PyErr_SetInterrupt if the SIGINT signal is ignored or not handled (GH-7778) https://github.com/python/cpython/commit/310f414bbd4d6ed1d8813f724c91ce

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2019-05-24 Thread miss-islington
Change by miss-islington : -- pull_requests: +13455 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2019-05-24 Thread Antoine Pitrou
Antoine Pitrou added the comment: It's just a bugfix to avoid a rogue exception. It sounds gratuitous to add markers for bug fixes in the documentation. -- versions: +Python 3.7, Python 3.8 -Python 2.7, Python 3.5 ___ Python tracker

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2019-05-24 Thread STINNER Victor
STINNER Victor added the comment: The interrupt_main() documentation needs a "versionchanged:: 3.8" to document that the behavior changed in Python 3.8, no? (do nothing if the signal is not handled by Python). I'm not comfortable to backport this change. I suggest to only change Python 3.8

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2019-05-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset 608876b6b1eb59538e6c29671a733033fb8b5be7 by Antoine Pitrou (Matěj Cepl) in branch 'master': bpo-23395: Fix PyErr_SetInterrupt if the SIGINT signal is ignored or not handled (GH-7778) https://github.com/python/cpython/commit/608876b6b1eb59538e6c2

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2018-06-18 Thread Matej Cepl
Change by Matej Cepl : -- pull_requests: +7385 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2018-06-18 Thread Matej Cepl
Change by Matej Cepl : -- pull_requests: +7384 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2018-06-18 Thread Matej Cepl
Change by Matej Cepl : -- nosy: +mcepl ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.or

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-12-08 Thread Wataru Matsumoto
Wataru Matsumoto added the comment: Recently I've encountered the similar problem. I found the case that SIGINT signal is ignored(set as SIG_IGN) due to the external reason. If the python program starts background in bash script, bash set SIGINT as SIG_IGN. test_interrupt.py import _thread _th

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-12-08 Thread Wataru Matsumoto
Changes by Wataru Matsumoto : -- nosy: +sxsns243 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-28 Thread STINNER Victor
STINNER Victor added the comment: > It seems to be against the current HEAD -- is there a chance that this will > be backported to 2.7 (which is what I need to use)? Yes, I will fix Python 2.7 and 3.5, I will just make PyErr_SetInterruptWithErr() private (rename to _PyErr_SetInterruptWithErr()

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-27 Thread Andre Merzky
Andre Merzky added the comment: I can confirm that the patch provided by Victor addresses the problem. It seems to be against the current HEAD -- is there a chance that this will be backported to 2.7 (which is what I need to use)? Thanks! Andre. -- _

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-27 Thread STINNER Victor
STINNER Victor added the comment: Attached interrupt_main.patch fixes for _thread.interrupt_main(): raise an exception if the SIGINT signal is ignored (SIG_IGN) or not handled by Python (SIG_DFL). My patch updates the documentation and addds unit tests. issue23395.2.patch looks wrong: it's no

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-26 Thread Andre Merzky
Andre Merzky added the comment: It seems you were right, that needed a DecRef indeed: the IncRef is already called on construction. The DecRef for the result also needed fixing - an updated patch is attached. -- Added file: http://bugs.python.org/file43546/issue23395.2.patch

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-26 Thread Andre Merzky
Andre Merzky added the comment: thanks for looking into this! And also, thanks for the details in the original bug report -- I found this by chance, after unsuccessfully banging my head against this very problem for quite a while! I am not sure if the DecRef needs to be called really if the

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-26 Thread Thomas Kluyver
Thomas Kluyver added the comment: Does Py_DECREF(arglist); need to be called in all cases? I'm genuinely unsure, as I don't usually work on C code, but my guess would be that it does. I'm not sure whether review is now done on Github. -- ___ Python

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-26 Thread Andre Merzky
Andre Merzky added the comment: Attached is a patch which seems to resolve the issue for me -- this now triggers the expected `KeyboardInterrupt` in the main thread. For verification one can run the unaltered code as provided by Thomas. I would very much appreciate feedback, to make sure that

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-26 Thread Andre Merzky
Andre Merzky added the comment: Thanks Thomas. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-26 Thread Thomas Kluyver
Thomas Kluyver added the comment: It's waiting for someone to make a patch - I'm no longer running into it, so it's not high on my priority list. Given that it's been over a year since I created this issue, it's probably not about to get fixed unless you've got some time to work on it. --

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-26 Thread Andre Merzky
Changes by Andre Merzky : -- versions: +Python 2.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-26 Thread Andre Merzky
Andre Merzky added the comment: Thanks for the PingBack, Thomas. I am not very familiar with the Python community approach to bug reports, so can someone comment if that is worth waiting for to get fixed, or is it that a rather futile hope without providing a patch myself? I don't think I cur

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-26 Thread Thomas Kluyver
Thomas Kluyver added the comment: As far as I know it has not been fixed. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2016-06-26 Thread Andre Merzky
Andre Merzky added the comment: Did anything ever come of this? I also frequently stumble over that error -- but alas not in a debug setting, but on actual running code... :/ -- nosy: +Andre Merzky ___ Python tracker

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2015-02-04 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +haypo, neologix ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue23395] _thread.interrupt_main() errors if SIGINT handler in SIG_DFL, SIG_IGN

2015-02-04 Thread Thomas Kluyver
New submission from Thomas Kluyver: In tracking down an obscure error we were seeing, we boiled it down to this test case for thread.interrupt_main(): import signal, threading, _thread, time signal.signal(signal.SIGINT, signal.SIG_DFL) # or SIG_IGN def thread_run(): _thread.interrupt_main(