Author David.Manowitz
Recipients David.Manowitz, docs@python, ggenellina, jgehrcke, pitrou, stutzbach, terry.reedy
Date 2012-03-26.17:40:32
SpamBayes Score 5.2889e-11
Marked as misclassified No
Message-id <>
In-reply-to <>
I have a couple of issues with that argument:

1.) Until fairly recently, the fact that sys.exit() when called from a
non-primary thread only causes the thread to die, was not clearly
documented (and still isn't in the python2.6 docs).  Admittedly,
thread.exit() does say that it raises the SystemExit exception, but as most
people are encouraged to use the *threading* module, rather than the
*thread* module directly, this is still fairly obscure.

2.) A ThreadExit exception could be derived from the SystemExit exception,
so existing code that works by catching a SystemExit exception would still


On Sat, Mar 24, 2012 at 6:47 AM, Antoine Pitrou <>wrote:

> Antoine Pitrou <> added the comment:
> > I don't see why this should be considered acceptable behavior.  Why
> > don't threads have their own ThreadExit exception, rather than
> > overloading the use, and therefore, the meaning, of the SystemExit
> > exception?  As indicated by their names, sys.exit and the SystemExit
> > exception should *only* be used to exit the entire system, not just a
> > thread!
> I agree the situation isn't optimal. However, fixing this would also break
> compatibility with any application that uses sys.exit() in a thread and
> expects it to exit the thread, not the whole process. So we're kind of
> stuck with it.
> ----------
> nosy: +pitrou
> _______________________________________
> Python tracker <>
> <>
> _______________________________________
Date User Action Args
2012-03-26 17:40:33David.Manowitzsetrecipients: + David.Manowitz, terry.reedy, ggenellina, pitrou, stutzbach, jgehrcke, docs@python
2012-03-26 17:40:32David.Manowitzlinkissue6634 messages
2012-03-26 17:40:32David.Manowitzcreate