Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

ZackerySpytz
Copy link
Contributor

@ZackerySpytz ZackerySpytz commented Nov 15, 2019

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

ZackerySpytz commented Nov 15, 2019

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

taleinat commented Nov 15, 2019

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

taleinat commented Nov 15, 2019

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

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
3 checks passed
@miss-islington
Copy link
Contributor

miss-islington commented Jan 28, 2021

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

miss-islington commented Jan 28, 2021

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 <tjreedy@udel.edu>
(cherry picked from commit 23a567c)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
@bedevere-bot
Copy link

bedevere-bot commented Jan 28, 2021

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 <tjreedy@udel.edu>
(cherry picked from commit 23a567c)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
@bedevere-bot
Copy link

bedevere-bot commented Jan 28, 2021

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 <tjreedy@udel.edu>
(cherry picked from commit 23a567c)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
terryjreedy pushed 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 <zspytz@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 23a567c)
@python python deleted a comment from bedevere-bot Jan 29, 2021
@terryjreedy
Copy link
Member

terryjreedy commented Jan 29, 2021

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 <tjreedy@udel.edu>
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.

None yet

6 participants