Skip to content

bpo-23544: Disable IDLE Stack Viewer when running user code - #17163

Merged
terryjreedy merged 4 commits into
python:masterfrom
ZackerySpytz:bpo-23544-idle-hangs-stack-viewer-debug
Jan 28, 2021
Merged

terryjreedy merged 4 commits into
python:masterfrom
ZackerySpytz:bpo-23544-idle-hangs-stack-viewer-debug

Conversation

@ZackerySpytz

@ZackerySpytz ZackerySpytz commented Nov 15, 2019

Copy link
Copy Markdown
Contributor

Starting stack viewer when user code is running hangs IDLE.

https://bugs.python.org/issue23544

"Stack Viewer" is now disabled when user code is running.
@ZackerySpytz

Copy link
Copy Markdown
Contributor Author

An alternative fix would be to use a method like EditorWindow.right_menu_event(), where individual methods are specified via verify_state for submenu items.

@taleinat

Copy link
Copy Markdown
Contributor

I like this approach!

I suggest also moving the check for the existence of sys.last_traceback from open_stack_viewer() to the postcommand, which would allow removing a nice chunk of error handling code there.

@taleinat

Copy link
Copy Markdown
Contributor

Currently, selecting "Debug -> Stack Viewer" also fails if a successful command was last run, or even just an empty statement. If fails after a small delay and just sounds the bell rather than displaying an error box. Ideally, we would recognize that case as well and have the menu option disabled in such cases.

@terryjreedy terryjreedy changed the title bpo-23544: IDLE hangs when selecting Stack Viewer with debug active bpo-23544: Disable IDLE Stack Viewer when running user code Jan 28, 2021

@terryjreedy terryjreedy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I changed index patterns to not care about trivial changes, such as 'Stack Viewer' to 'Stack viewer' and to fail given inconsistent menu and pattern changes. I manually tested that everything works.

I will merge this when CI passes to fix hangs (user code executing) and crashes (Debugger active). I would test and likely merge a new patch to allow a stack viewer anytime. If either of you decide to do it, open and issue and say so.

@terryjreedy
terryjreedy merged commit 23a567c into python:master Jan 28, 2021
@terryjreedy terryjreedy added needs backport to 3.8 type-bug An unexpected behavior, bug, or error labels Jan 28, 2021
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @ZackerySpytz for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @ZackerySpytz for the PR, and @terryjreedy for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 28, 2021
…-17163)

Starting stack viewer when user code is running, including when Debugger is active, hangs or crashes IDLE.

Co-authored-by: Terry Jan Reedy <[email protected]>
(cherry picked from commit 23a567c)

Co-authored-by: Zackery Spytz <[email protected]>
@bedevere-bot

Copy link
Copy Markdown

GH-24365 is a backport of this pull request to the 3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 28, 2021
…-17163)

Starting stack viewer when user code is running, including when Debugger is active, hangs or crashes IDLE.

Co-authored-by: Terry Jan Reedy <[email protected]>
(cherry picked from commit 23a567c)

Co-authored-by: Zackery Spytz <[email protected]>
@bedevere-bot

Copy link
Copy Markdown

GH-24366 is a backport of this pull request to the 3.8 branch.

miss-islington added a commit that referenced this pull request Jan 28, 2021
Starting stack viewer when user code is running, including when Debugger is active, hangs or crashes IDLE.

Co-authored-by: Terry Jan Reedy <[email protected]>
(cherry picked from commit 23a567c)

Co-authored-by: Zackery Spytz <[email protected]>
terryjreedy added a commit that referenced this pull request Jan 29, 2021
#24366)

Starting stack viewer when user code is running, including when Debugger is active, hangs or crashes IDLE.

Co-authored-by: Zackery Spytz <[email protected]>
Co-authored-by: Terry Jan Reedy <[email protected]>
(cherry picked from commit 23a567c)
@python python deleted a comment from bedevere-bot Jan 29, 2021
@terryjreedy

Copy link
Copy Markdown
Member

splat from unrelated 3 tests failed:
test_gdb test_subprocess test_venv

adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
…-17163)

Starting stack viewer when user code is running, including when Debugger is active, hangs or crashes IDLE.

Co-authored-by: Terry Jan Reedy <[email protected]>
terryjreedy pushed a commit that referenced this pull request Sep 16, 2026
…157599)

Like Stack Viewer since GH-17163, instead of a "Don't debug now" box.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
terryjreedy pushed a commit that referenced this pull request Sep 16, 2026
…runs (GH-157599) (#157603)

gh-69004: Disable the IDLE Debugger menu item while user code runs (GH-157599)

Like Stack Viewer since GH-17163, instead of a "Don't debug now" box.
(cherry picked from commit 2f04bda)

Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
serhiy-storchaka added a commit that referenced this pull request Sep 16, 2026
…runs (GH-157599) (GH-157604)

Like Stack Viewer since GH-17163, instead of a "Don't debug now" box.
(cherry picked from commit 2f04bda)

Co-authored-by: Serhiy Storchaka <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants