Menu

#376 Easily corrected error cause failure to open debugger

closed-fixed
nobody
pythonwin (177)
5
2008-09-03
2008-07-31
No

Hi,

when entering the debugger through a break-point or post-mortem, I often get the following traceback:

File "C:\Quantax\trunk\Zope\Python\Lib\site-packages\pythonwin\pywin\debugger\__init__.py", line 110, in post_mortem
p.done_run()
File "C:\Quantax\trunk\Zope\Python\Lib\site-packages\pythonwin\pywin\debugger\debugger.py", line 542, in done_run
self.RespondDebuggerState(DBGSTATE_NOT_DEBUGGING)
File "C:\Quantax\trunk\Zope\Python\Lib\site-packages\pythonwin\pywin\debugger\debugger.py", line 769, in RespondDebuggerState
cb.RespondDebuggerState(state)
File "C:\Quantax\trunk\Zope\Python\Lib\site-packages\pythonwin\pywin\debugger\debugger.py", line 202, in RespondDebuggerState
self.list.Refresh()
File "C:\Quantax\trunk\Zope\Python\Lib\site-packages\pythonwin\pywin\tools\hierlist.py", line 215, in Refresh
self.AddItem(hparent, newItem)
File "C:\Quantax\trunk\Zope\Python\Lib\site-packages\pythonwin\pywin\tools\hierlist.py", line 140, in AddItem
text = self.GetText(item)
File "C:\Quantax\trunk\Zope\Python\Lib\site-packages\pythonwin\pywin\tools\hierlist.py", line 266, in GetText
return self.DelegateCall( item.GetText )
File "C:\Quantax\trunk\Zope\Python\Lib\site-packages\pythonwin\pywin\tools\hierlist.py", line 255, in DelegateCall
return fn()
File "C:\Quantax\trunk\Zope\Python\Lib\site-packages\pythonwin\pywin\debugger\debugger.py", line 58, in GetText
name = self.myobject.f_locals['__name__'] + " module"
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

This can be corrected easily by putting an str() around
self.myobject.f_locals['__name__'] in debugger.HierFrameItem[58] or a get with check against None instead of the has_key() in the line above.

I did not investigate why the f_locals exists and is None, just cured the symptoms.

Best regards, Martin

HierFrameItem

Discussion

  • Roger Upole

    Roger Upole - 2008-09-03

    Logged In: YES
    user_id=771074
    Originator: NO

    I've run into this myself on rare occasions. This seems fairly
    safe and doesn't break anything, so I've committed it.

     
  • Roger Upole

    Roger Upole - 2008-09-03
    • status: open --> closed-fixed