New submission from Elliot Jenner <void2...@gmail.com>:

Ptyhon lacks a reliable clean shutdown method. sys.exit(), which should be this 
method, does not reliably perform this function as it merely terminates the 
thread it is called from (duplicating the functionality of thread.exit()), 
exit() and quit() are not supposed to be used except in terminal windows, raise 
SystemExit has the same issues as sys.exit() and is bad practice, and 
os._exit() immediately kills everything and does not clean up, which can cause 
issues with residuals.

This is especially important as some interpreters will break calls (including 
most worryingly try-except clauses) into threads invisibly, leading to 
whichever method is used being called in a non-main thread without anything the 
programmer can do about it even when you are not intentionally using threading.

Ideally, sys.exit() should be changed to properly close down the entire 
program, as there is no need for 2 functionally identical exit functions, but 
this may cause legacy issues. Regardless, a method that ALWAYS kill the program 
and all threads while still cleaning up, regardless of where it is called from, 
is needed.

----------
components: Library (Lib)
messages: 313961
nosy: Void2258
priority: normal
severity: normal
status: open
title: No reliable clean shutdown method
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33087>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to