Skip to content

Conversation

@ZackerySpytz
Copy link
Contributor

@ZackerySpytz ZackerySpytz commented Nov 15, 2019

"Stack Viewer" is now disabled when user code is running.
@ZackerySpytz
Copy link
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
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
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
Copy link
Member

@terryjreedy terryjreedy left a comment

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

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

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
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]>
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