python / cpython

The Python programming language
https://www.python.org
Other
62.92k stars 30.14k forks source link

IDLE crashes when Stack Viewer opened #55278

Closed 3c0dd89b-73dc-490c-a048-e246a78e9b63 closed 13 years ago

3c0dd89b-73dc-490c-a048-e246a78e9b63 commented 13 years ago
BPO 11069
Nosy @birkenfeld, @kbkaiser, @ned-deily, @briancurtin

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: ```python assignee = None closed_at = created_at = labels = ['expert-IDLE', 'type-bug', 'OS-windows'] title = 'IDLE crashes when Stack Viewer opened' updated_at = user = 'https://bugs.python.org/YakovBlum' ``` bugs.python.org fields: ```python activity = actor = 'brian.curtin' assignee = 'none' closed = True closed_date = closer = 'georg.brandl' components = ['IDLE', 'Windows'] creation = creator = 'Yakov.Blum' dependencies = [] files = [] hgrepos = [] issue_num = 11069 keywords = [] message_count = 9.0 messages = ['127509', '127510', '127511', '127514', '127515', '127520', '127527', '127532', '127547'] nosy_count = 5.0 nosy_names = ['georg.brandl', 'kbk', 'ned.deily', 'brian.curtin', 'Yakov.Blum'] pr_nums = [] priority = 'normal' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = 'behavior' url = 'https://bugs.python.org/issue11069' versions = ['Python 3.1'] ```

3c0dd89b-73dc-490c-a048-e246a78e9b63 commented 13 years ago

This problem was asked about on Stack Overflow, where there's some more information on it: http://stackoverflow.com/questions/4046021/python-idle-windows-pressing-stack-viewer-exits-all-idle-windows

But I didn't see it listed as a bug here. I've also experienced it in Python 3.1.3

ned-deily commented 13 years ago

According to the StackOverflow report, the crash occurs on Python 3.1.2 with IDLE 3.1.2 on Windows 7.

3c0dd89b-73dc-490c-a048-e246a78e9b63 commented 13 years ago

A few additional details:

I'm also running Windows 7.

Reproducing the crash is as simple as opening IDLE, typing, e.g., raise TypeError and clicking Debug > Stack Viewer

briancurtin commented 13 years ago

I don't get a crash, but it certainly doesn't work. Once IDLE is open I type "raise TypeError", then open the stack viewer as you did. Here's what I'm seeing:

[WINSEVEN] 2011-01-29 21:05:30.18 c:\Users\brian

c:\python31\python.exe -m idlelib.idle *** Internal Error: rpc.py:SocketIO.localcall()

Object: 49395136 Method: \<bound method WrappedObjectTreeItem._GetSubList of \<idlelib.RemoteObjec tBrowser.WrappedObjectTreeItem object at 0x0000000002F1B5C0>> 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
    return list(map(remote_object_tree_item, list))
TypeError: 'list' object is not callable
Exception in Tkinter callback
Traceback (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()
  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 iterable

briancurtin commented 13 years ago

The following patch will fix it. Another example of why 'list' isn't a great name :)

Index: Lib/idlelib/RemoteObjectBrowser.py \=================================================================== --- Lib/idlelib/RemoteObjectBrowser.py (revision 88248) +++ Lib/idlelib/RemoteObjectBrowser.py (working copy) @@ -17,8 +17,8 @@ return value

     def _GetSubList(self):
-        list = self.__item._GetSubList()
-        return list(map(remote_object_tree_item, list))
+        sub_list = self.__item._GetSubList()
+        return list(map(remote_object_tree_item, sub_list))
 class StubObjectTreeItem:
     # Lives in IDLE process
birkenfeld commented 13 years ago

Thanks, applied in r88258.

briancurtin commented 13 years ago

This should be back-ported to the maintenance branch as well. I can take care of that if Georg is busy with release-related stuff.

birkenfeld commented 13 years ago

Please do.

briancurtin commented 13 years ago

Fixed in release31-maint in r88269.