Eryk Sun <eryk...@gmail.com> 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_C_EXIT = 0xC000013A - 2**32 >>> STATUS_CONTROL_C_EXIT -1073741510 >>> sys.exit(STATUS_CONTROL_C_EXIT) ^C C:\>echo %errorlevel% -1073741510 Note that switching to SIG_DFL with raise(SIGINT) does not invoke the default console control handler in Windows. It just invokes the default raise() behavior, which is to call _exit(3). This exit status value of 3 is arbitrary and meaningless. ---------- nosy: +eryksun _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue1054041> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com