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

bpo-36667: pdb: restore SIGINT handler in sigint_handler already#12880

Open
blueyed wants to merge 1 commit intopython:mainpython/cpython:mainfrom
blueyed:pdb-sigint-restoreblueyed/cpython:pdb-sigint-restoreCopy head branch name to clipboard
Open

bpo-36667: pdb: restore SIGINT handler in sigint_handler already#12880
blueyed wants to merge 1 commit intopython:mainpython/cpython:mainfrom
blueyed:pdb-sigint-restoreblueyed/cpython:pdb-sigint-restoreCopy head branch name to clipboard

Conversation

@blueyed
Copy link
Contributor

@blueyed blueyed commented Apr 19, 2019

Without this, and additional SIGINT while waiting for the next statement
(e.g. during time.sleep) will stop at sigint_handler.

With this patch:

> …/t-pdb-sigint-in-await.py(29)<module>()
-> f()
(Pdb) c
^C
Program interrupted. (Use 'cont' to resume).
^CKeyboardInterrupt
> …/t-pdb-sigint-in-await.py(23)sleep()
-> time.sleep(10)
(Pdb)

Without this patch:

> …/t-pdb-sigint-in-await.py(29)<module>()
-> f()
(Pdb) c
^C
Program interrupted. (Use 'cont' to resume).
^C--Call--
> …/cpython/Lib/pdb.py(188)sigint_handler()
-> def sigint_handler(self, signum, frame):
(Pdb)

https://bugs.python.org/issue36667

TODO:

  • test
  • changelog

@blueyed
Copy link
Contributor Author

blueyed commented Apr 19, 2019

Hmm, this was move/changed in 10e54ae.
It is not clear though why it was moved, and not only made a class attribute (which should fix the reference leak already I assume?).

@blueyed blueyed force-pushed the pdb-sigint-restore branch from 7bb2610 to f8e5042 Compare April 19, 2019 11:05
@blueyed blueyed changed the title pdb: restore SIGINT handler in sigint_handler already bpo-36667: pdb: restore SIGINT handler in sigint_handler already Apr 19, 2019
Without this, and additional SIGINT while waiting for the next statement
(e.g. during `time.sleep`) will stop at `sigint_handler`.

With this patch:

    > …/t-pdb-sigint-in-sleep.py(10)<module>()
    -> sleep()
    (Pdb) c
    ^C
    Program interrupted. (Use 'cont' to resume).
    ^CKeyboardInterrupt
    > …/t-pdb-sigint-in-sleep.py(6)sleep()
    -> time.sleep(10)
    (Pdb)

Without this patch:

    > …/t-pdb-sigint-in-sleep.py(10)<module>()
    -> sleep()
    (Pdb) c
    ^C
    Program interrupted. (Use 'cont' to resume).
    ^C--Call--
    > …/cpython/Lib/pdb.py(188)sigint_handler()
    -> def sigint_handler(self, signum, frame):
    (Pdb)
@blueyed blueyed force-pushed the pdb-sigint-restore branch from f8e5042 to 9f316bd Compare April 19, 2019 11:11
Copy link

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add test?

@python-cla-bot
Copy link

python-cla-bot bot commented Apr 6, 2025

The following commit authors need to sign the Contributor License Agreement:

CLA signed

@github-actions
Copy link

github-actions bot commented Jan 1, 2026

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Stale PR or inactive for long period of time. label Jan 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

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