Message 335488 - Python tracker

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.

Content
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.