[docs] [issue6634] sys.exit() called from threads other than the main one: undocumented behaviour

Antoine Pitrou report at bugs.python.org
Sat Mar 24 11:47:52 CET 2012

Antoine Pitrou <pitrou at free.fr> 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 <report at bugs.python.org>

More information about the docs mailing list