-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
IDLE hangs when selecting Stack View with debug active #67732
Comments
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 23 2015, 02:52:03)
|
Thanks for the detailed report. The problem is more general as it is reproducible on Linux X11-based IDLEs as well. |
Verified on Windows whenever the debugger is active, meaning that a program is running. (Debug On just means that it will become active when code is run.) No stepping is needed; debugger can be pointing to the inital docstring line. For me also, Idle stops and has to be externally closed, as opposed to totally disappearing by itself. The doc for Stack Viewer says "Show the stack traceback of the last exception". Example: >>> 1/0
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
1/0
ZeroDivisionError: division by zero
>>> Selecting Stack Viewer pops up a viewer box. This still works after
Selecting Stack Viewer while a program is running (sleeping in this next example)
brings up a box after the exception is printed. So 'last exception' can actually be 'next exception'. But in this case, the user process is left 'running' and no '>>> ' prompt appears, and one must Shell -> Restart to do anything further. This is not good behavior. When one selects Debug -> Debugger while user code is running, Idle brings up a message box "Don't debug now: You can only toggle the debugger when idle". I think Debug -> Stack Viewer should be similarly disabled, though perhaps graying out the menu entry might be better. It could also be grayed out when there the 'last exception' cannot be viewed because other code has been run. Stack Viewer should definitely be ignored when the debugger is active, and I see no need to let people select it *before* an exception occurs and the prompt is displayed. The next menu entry, Auto-open Stack Viewer, takes care of opening upon future exceptions. |
I was using this without looking at documentation, as a newbies would. On Fri, Feb 27, 2015 at 4:49 PM, Terry J. Reedy <report@bugs.python.org> >
> Terry J. Reedy added the comment:
>
> Verified on Windows whenever the debugger is active, meaning that a
> program is running. (Debug On just means that it will become active when
> code is run.) No stepping is needed; debugger can be pointing to the inital
> docstring line. For me also, Idle stops and has to be externally closed,
> as opposed to totally disappearing by itself.
>
> The doc for Stack Viewer says "Show the stack traceback of the last
> exception". Example:
>
> >>> 1/0
> Traceback (most recent call last):
> File "<pyshell#0>", line 1, in <module>
> 1/0
> ZeroDivisionError: division by zero
> >>>
>
> Selecting Stack Viewer pops up a viewer box. This still works after
> [DEBUG ON]
> >>>
> turns the debugger on but inactive. Entering anything at the prompt
> disables viewing the 'last' exception, contrary to my understanding of the
> short doc. So I might add '(if no other code has been run)' to the doc.
>
> Selecting Stack Viewer while a program is running (sleeping in this next
> example)
>
> >>> import time; time.sleep(10); 1/0
>
> brings up a box after the exception is printed. So 'last exception' can
> actually be 'next exception'. But in this case, the user process is left
> 'running' and no '>>> ' prompt appears, and one must Shell -> Restart to do
> anything further. This is not good behavior.
>
> When one selects Debug -> Debugger while user code is running, Idle brings
> up a message box "Don't debug now: You can only toggle the debugger when
> idle". I think Debug -> Stack Viewer should be similarly disabled, though
> perhaps graying out the menu entry might be better. It could also be grayed
> out when there the 'last exception' cannot be viewed because other code has
> been run. Stack Viewer should definitely be ignored when the debugger is
> active, and I see no need to let people select it *before* an exception
> occurs and the prompt is displayed. The next menu entry, Auto-open Stack
> Viewer, takes care of opening upon future exceptions.
>
>
-- |
I agree that 'Stack Viewer' does not explain what this does, which is to gives a more detail view of the stack and name bindings after an exception. The doc entry does not either. I will consider 'Stack Trace' or maybe 'Exception Review'. I think a popup message is needed too. PS. When replying to email, please snip the messages you are responding to (except possible for a line or two). That message sits above yours when viewed on the web page. |
This crashes or hangs the user execution process, but not the IDLE process. So Shell => 'Restart Shell cntl-F6' still works. |
Taking this in a different direction, perhaps we can make the stack viewer always work, regardless of whether it is immediately after an exception? Visually inspecting the stack can be useful not just for understanding error cases. |
Well, perhaps not "always", e.g. probably not while user code is running. |
Tal, I agree with you. The debugger is an execution controller with an optional current-frame viewer updated whenever execution is paused. It displays both name and value. I believe a current PR addresses the issue of value representations being indefinitely long and possibly overflowing the space allotted. The stack viewer can view any frame on the stack, but only after an exception. At least currently, on Windows, it omits value names. And there are other issues (bpo-24790). The debugger viewer and stack viewer should be combined with the best features of each (new issues). In the meanwhile, I finished PR and merged. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: