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.

Author abacabadabacaba
Recipients abacabadabacaba
Date 2015-05-21.22:14:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1432246479.21.0.632354289175.issue24261@psf.upfronthosting.co.za>
In-reply-to
Content
Currently, Python always changes handling of certain signals on startup: SIGPIPE is ignored, and SIGINT is handled by a function that raises KeyboardInterrupt exception. As a result, if the user presses Ctrl-C, a backtrace is printed to stderr.

Some program may want to change this behavior. For example, they may want to print a user-friendly message, or to terminate without printing anything. They may do that by two means: either by installing their own handler for SIGINT, or by using a try..except block to handle the KeyboardInterrupt exception. However, they both have a flaw: if SIGINT is received during startup, before the program begins execution, the ugly KeyboardInterrupt backtrace is printed nevertheless. So, I propose to add a way to stop Python from installing this default SIGINT handler. I think that the most obvious way is to add a command line switch.

This switch should prevent Python from installing its SIGINT handler. It may also prevent it from ignoring SIGPIPE, so that all signal actions would stay the same as when the program was executed. After that, programs may use signal module to set up their own handlers, if that is desired.
History
Date User Action Args
2015-05-21 22:14:39abacabadabacabasetrecipients: + abacabadabacaba
2015-05-21 22:14:39abacabadabacabasetmessageid: <1432246479.21.0.632354289175.issue24261@psf.upfronthosting.co.za>
2015-05-21 22:14:39abacabadabacabalinkissue24261 messages
2015-05-21 22:14:38abacabadabacabacreate