This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Interrupt/kill threads w/exception
Type: enhancement Stage: needs patch
Components: Interpreter Core Versions: Python 3.10, Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: oliverbock
Priority: normal Keywords:

Created on 2006-06-20 04:30 by oliverbock, last changed 2022-04-11 14:56 by admin.

Messages (2)
msg61241 - (view) Author: Oliver Bock (oliverbock) Date: 2006-06-20 04:30
When unsophisticated (but not evil) users write Python
macros, they occasionally write infinite loops.  It
would be nice if it was possible to interrupt threads
to break these loops.  The safety of rasing an
exception in another thread was noted in

http://sourceforge.net/tracker/?func=detail&atid=305470&aid=452266&group_id=5470

Anton Wilson wrote a patch for this some time ago:

http://mail.python.org/pipermail/python-list/2003-February/148999.html

Note that this won't help if the thread is blocked on I/O.
msg61242 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2006-06-23 18:24
Logged In: YES 
user_id=341410

It would be nice to be able to kill runaway threads, though
I have no comment on the patch that Anton Wilson offers
(which will no doubt need to be updated for more recent
Pythons).
History
Date User Action Args
2022-04-11 14:56:18adminsetgithub: 43528
2020-10-30 23:30:21iritkatrielsetstage: test needed -> needs patch
versions: + Python 3.9, Python 3.10, - Python 3.2
2019-05-02 04:32:26josiahcarlsonsetnosy: - josiahcarlson
2010-08-09 03:40:42terry.reedysetversions: + Python 3.2, - Python 3.1, Python 2.7
2009-03-30 06:33:03ajaksu2setstage: test needed
versions: + Python 3.1, Python 2.7
2006-06-20 04:30:39oliverbockcreate