Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

pyrepl messed up terminal if a signal handler expects stdin #130168

Copy link
Copy link
Open
@gaogaotiantian

Description

@gaogaotiantian
Issue body actions

Bug report

Bug description:

This is related to #129614 but more straightforward and irrelevant to pdb. (pdb needs this to be fixed though)

Start REPL from a terminal and do

import signal
signal.signal(signal.SIGINT, lambda s, f: input("test"))
<Ctrl+C>

Your terminal is messed up and newline won't work anymore. (Not the Python repl which will exit due to some run time error, the terminal itself is messed up)

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirPython modules in the Lib dirtopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.