[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-23 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 06babb24225d41a76e4aee975380294ca1ee1d7c by Gregory P. Smith in branch 'master': bpo-1054041: Add What's New docs. (GH-11999) https://github.com/python/cpython/commit/06babb24225d41a76e4aee975380294ca1ee1d7c -- _

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-23 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +12029 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-20 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +11989 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-19 Thread Gregory P. Smith
Gregory P. Smith added the comment: i'm curious if this _ever_ comes up so i'd like to leave it in at least through some betas. I don't believe it should be possible. If it is, it'd probably be a restricted execution environment that fails all signal() calls. all perror will do is emit an

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-19 Thread STINNER Victor
STINNER Victor added the comment: > if (PyOS_setsig(SIGINT, SIG_DFL) == SIG_ERR) { >perror("signal"); /* Impossible in normal environments. */ In my experience, Python is were impossible things happen. Would it be possible to write a better error message to explain what happened? I expe

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-16 Thread Gregory P. Smith
Gregory P. Smith added the comment: This is in for 3.8. On earlier or unpatched Python versions: application owners have a workaround f they do not mind skipping a clean application shutdown (destructors) on posix platforms: catch KeyboardInterrupt, reset SIGINT to SIG_DFL, kill(getpid(), SI

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-16 Thread Gregory P. Smith
Gregory P. Smith added the comment: New changeset 38f11cc3f62db11a4a24354bd06273322ac91afa by Gregory P. Smith in branch 'master': bpo-1054041: Exit properly after an uncaught ^C. (#11862) https://github.com/python/cpython/commit/38f11cc3f62db11a4a24354bd06273322ac91afa --

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-14 Thread Gregory P. Smith
Change by Gregory P. Smith : -- pull_requests: +11895 stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-li

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-14 Thread Eryk Sun
Change by Eryk Sun : Added file: https://bugs.python.org/file48142/winsig.py ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-14 Thread Eryk Sun
Eryk Sun added the comment: Gregory's last example reminded me that CMD checks for STATUS_CONTROL_C_EXIT for more than simply printing "^C". It also breaks out of a FOR loop when interactive and prompts to continue when executing a batch script. Normally CMD also gets a console control event

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-14 Thread Gregory P. Smith
Gregory P. Smith added the comment: jwilk: Confirmed. The exit code is not enough, we must trigger the SIG_DFL handler. to reproduce: while true; do ./sig.py ; done with the attached sig.py. pass a parameter to sig.py to have it exit 130 instead of triggering SIG_DFL... -- Added

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: I'm assuming the calling shell uses waitpid() and then WIFSIGNALED()? -- ___ Python tracker ___ ___

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-14 Thread Jakub Wilk
Jakub Wilk added the comment: This issue was reported because with the current behavior, "the script will not properly exit on C-c". Exiting with code 128+SIGINT will not fix this. Please re-raise the signal. -- ___ Python tracker

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-13 Thread Eryk Sun
Eryk Sun added the comment: For Windows, the default console control handler calls ExitProcess(STATUS_CONTROL_C_EXIT). If CMD is waiting on an application that exits with STATUS_CONTROL_C_EXIT, it prints "^C" to indicate the process was killed by Ctrl+C. For example: >>> STATUS_CONTROL_

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-13 Thread Gregory P. Smith
Gregory P. Smith added the comment: I expect that'll work as desired and avoids the re-raising of the signal. Unless told otherwise I assume this should be a POSIX specific platform behavior. ie: no return value alteration due to an uncaught KeyboardInterrupt on the Windows API build.

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-13 Thread STINNER Victor
STINNER Victor added the comment: > A question that leads to is what _is_ the correct value. What do you think of using a short test program (ex: uses raise(SIGINT)) in ./configure to get the "default exit code" to define a constant, and then use the constant for exit() in Python? I dislike

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-13 Thread Gregory P. Smith
Change by Gregory P. Smith : -- stage: patch review -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-13 Thread Gregory P. Smith
Gregory P. Smith added the comment: Taking a renewed look at this 8 years later... I agree, re-triggering the signal with the SIG_DFL handler would prevent us from doing the existing interpreter shutdown cleanup if we did it too early which would be a behavior change other than the exit valu

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-13 Thread Gregory P. Smith
Change by Gregory P. Smith : -- versions: +Python 3.8 -Python 3.3 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2015-10-12 Thread Martin Panter
Martin Panter added the comment: This covers the same ground as Issue 14229, which was rejected with the argument that re-raising the signal is “ugly” and bypasses some things that are done by the standard OS exit() function. -- nosy: +martin.panter ___

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2014-05-28 Thread Samuel Bronson
Changes by Samuel Bronson : -- nosy: +SamB ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2013-05-25 Thread Jakub Wilk
Changes by Jakub Wilk : -- nosy: +jwilk ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.or

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2011-07-02 Thread Petri Lehtinen
Changes by Petri Lehtinen : -- stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2011-05-20 Thread STINNER Victor
STINNER Victor added the comment: +kill(getpid(), SIGINT); kill() doesn't exist on Windows: use raise() which is more portable and doesn't require a PID argument. We may need to do something on Windows for console applications: see SetConsoleCtrlHandler(), http://msdn.microsoft.com/e

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2011-05-19 Thread Petri Lehtinen
Changes by Petri Lehtinen : -- nosy: +petri.lehtinen ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://m

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2011-01-06 Thread Gregory P. Smith
Gregory P. Smith added the comment: > IMO, if we give the illusion that the interpreter was actually killed, > we should equate KeyboardInterrupt with SIGINT; any uncaught > KeyboardInterrupt should consequently always lead to raising SIGINT. Agreed. Plus that is easier to implement and what I

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2011-01-06 Thread Martin v . Löwis
Martin v. Löwis added the comment: I wonder whether there is a precedent of some system mapping SIGINT to an exception. We could probably learn something from them. > - should KeyboardInterrupt always exit with SIGINT, or only if it was > actually raised by a signal handler? IMO, if we give th

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2011-01-06 Thread Antoine Pitrou
Antoine Pitrou added the comment: - should KeyboardInterrupt always exit with SIGINT, or only if it was actually raised by a signal handler? - if _Py_UnhandledKeyboardInterrupt is defined in Modules/main.c but used in Python/pythonrun.c, can't it cause linker errors when embedding Python? - pl

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2011-01-06 Thread Reid Kleckner
Reid Kleckner added the comment: Looks good to me. Do you need the TODO(gps)'s in there after implementing the behavior described? -- ___ Python tracker ___

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2011-01-03 Thread Gregory P. Smith
Gregory P. Smith added the comment: Here's a patch that implements this behavior. It is too late in the 3.2 beta/rc cycle to get this into 3.2. Consider it for 3.3. I'd like a review. -- keywords: +needs review, patch Added file: http://bugs.python.org/file20251/issue1054041-sigint-

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2011-01-03 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +rnk ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2011-01-03 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +gregory.p.smith -BreamoreBoy stage: unit test needed -> needs patch type: behavior -> feature request versions: +Python 3.3 -Python 2.7, Python 3.1, Python 3.2 ___ Python tracker

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2010-08-19 Thread Stefan Krah
Changes by Stefan Krah : -- status: pending -> open ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2010-08-19 Thread Mark Lawrence
Mark Lawrence added the comment: I'll close this in a couple of weeks unless someone wants it kept open. -- nosy: +BreamoreBoy status: open -> pending type: feature request -> behavior versions: +Python 3.1, Python 3.2 ___ Python tracker

[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2009-02-14 Thread Daniel Diniz
Changes by Daniel Diniz : -- stage: -> test needed type: -> feature request versions: +Python 2.7 ___ Python tracker ___ ___ Pytho