Skip to content

Overriding SIGINT doesn't work as expected in the new REPL #120221

Closed
@pablogsal

Description

@pablogsal

Bug report

In the old REPL, overriding SIGINT and pressing Ctrl-C works as expected:

❯ python Python 3.11.6 (main, Nov 3 2023, 17:05:41) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import signal >>> signal.signal(signal.SIGINT, lambda *x: print("NOOOO")) <built-in function default_int_handler> >>> NOOOO NOOOO 

but in the new REPL it doesn't trigger the signal handler:

❯ ./python.exe Python 3.14.0a0 (heads/more_offsets-dirty:9403c2cf58, Jun 6 2024, 12:10:11) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import signal >>> signal.signal(signal.SIGINT, lambda *x: print("NOOOO")) <built-in function default_int_handler> >>> KeyboardInterrupt >>> 

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixesrelease-blockertopic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions