views:

28

answers:

2

I am running Python 3.1.2 with IDLE 3.1.2 on Windows 7. When I try to use the Stack Viewer, blue text and a new window briefly appear before all open IDLE windows exit (I don't have time to read the text or new window). This is the first time I have used Stack Viewer.

Is this normal behavior? How can I get the Stack Viewer to stay open?

Thanks for your help, Alex

A: 

From the documentation, the stack viewer shows the stack traceback of the last exception. So maybe in your case, you are trying to open the stack viewer, without any exception haven taken place?

>>> a

Traceback (most recent call last):
  File "<pyshell#30>", line 1, in <module>
    a
NameError: name 'a' is not defined

If you type 'a' and press ENTER, an exception occurs. Now try opening the stack viewer?

sukhbir
It crashes. I can press the Stack Viewer button before an exception and nothing happens, and I can turn on Auto Open Stack Viewer. But when I try to use it when an exception has occurred (or it auto opens), IDLE crashes.
Alex
What happens when you explicitly call Stack Viewer after an exception occurs. (Auto Open set to False)
sukhbir
IDLE briefly opens a new window, then all IDLE windows exit before I can read what it says.
Alex
Uhm, ok. Sorry can't help you more than this. Sounds n00bish, but maybe try a re-install? :)
sukhbir
Thanks for trying.
Alex
A: 

I don't have Windows so I can't help you with hands-on experience, but I would do the following:

  • see what is the exact command that runs when you click on the menu item for Idle (I think you can right-click and see its properties, or at least you could on earlier versions of Windows)
  • open a command prompt, and run the command that opens Idle
  • open the stack viewer and then note the traceback that (should!) appear in the command prompt window
  • report said traceback here :)

BTW, in my installation (neither Windows nor Python 3.x), an attempt to open the stack viewer without a traceback produces the following message box:

  • Title: No stack trace
  • Message: There is no stack trace yet.
    (sys.last_traceback is not defined)
ΤΖΩΤΖΙΟΥ
When I opened idle.py in Lib\idlelib, forced an exception, and used stack view IDLE stayed open. This appeared in the command prompt:C:\Python31\Lib\idlelib>python idle.py*** Internal Error: rpc.py:SocketIO.localcall() Object: 45342064 Method: <bound method WrappedObjectTreeItem._GetSubList of <idlelib.RemoteObjectBrowser.WrappedObjectTreeItem object at 0x02B3DD70>> Args: ()Traceback (most recent call last): File "c:\Python31\lib\idlelib\rpc.py", line 188, in localcall ret = method(*args, **kwargs) File "c:\Python31\lib\idlelib\RemoteObjectBrowser.py", line 21, in _GetSubList
Alex
return list(map(remote_object_tree_item, list))TypeError: 'list' object is not callableException in Tkinter callbackTraceback (most recent call last): File "C:\Python31\Lib\tkinter\__init__.py", line 1399, in __call__ return self.func(*args) File "C:\Python31\Lib\idlelib\PyShell.py", line 1171, in open_stack_viewer return self.interp.remote_stack_viewer() File "C:\Python31\Lib\idlelib\PyShell.py", line 572, in remote_stack_viewer node.expand() File "C:\Python31\Lib\idlelib\TreeWidget.py", line 131, in expand self.update()
Alex
File "C:\Python31\Lib\idlelib\TreeWidget.py", line 170, in update self.draw(7, 2) File "C:\Python31\Lib\idlelib\TreeWidget.py", line 184, in draw sublist = self.item._GetSubList() File "C:\Python31\Lib\idlelib\RemoteObjectBrowser.py", line 36, in _GetSubList return [StubObjectTreeItem(self.sockio, oid) for oid in list]TypeError: 'NoneType' object is not iterableIt also works when I just mouse open idle.py, but not when I open python.pyw. I suspect the IDLE shortcut points to idle.pyw
Alex