pudb icon indicating copy to clipboard operation
pudb copied to clipboard

PuDB abnormally terminates when switching to Breakpoints widget

Open volo-zyko opened this issue 8 years ago • 4 comments

This is really a corner case but still annoying. Normally, I'm not interested in marked breakpoints and thus I collapse the Breakpoints widget to zero (using [ key) to arrange for more space for Variables. So, when Breakpoints widget is collapsed and there is at least 1 breakpoint marked and I press "down" arrow till Breakpoints widget is selected and then past this line, PuDB terminates with the following stracktrace (I removed the part of stacktrace inside my application as it's not relevant):

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/bdb.py", line 49, in trace_dispatch
    return self.dispatch_line(frame)
  File "/Library/Python/2.7/site-packages/pudb/debugger.py", line 160, in dispatch_line
    self.user_line(frame)
  File "/Library/Python/2.7/site-packages/pudb/debugger.py", line 381, in user_line
    self.interaction(frame)
  File "/Library/Python/2.7/site-packages/pudb/debugger.py", line 349, in interaction
    show_exc_dialog=show_exc_dialog)
  File "/Library/Python/2.7/site-packages/pudb/debugger.py", line 2084, in call_with_ui
    return f(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/pudb/debugger.py", line 2322, in interaction
    self.event_loop()
  File "/Library/Python/2.7/site-packages/pudb/debugger.py", line 2288, in event_loop
    toplevel.keypress(self.size, k)
  File "/Library/Python/2.7/site-packages/pudb/ui_tools.py", line 96, in keypress
    result = self._w.keypress(size, key)
  File "/Library/Python/2.7/site-packages/urwid/container.py", line 1128, in keypress
    return self.body.keypress( (maxcol, remaining), key )
  File "/Library/Python/2.7/site-packages/urwid/container.py", line 2269, in keypress
    key = w.keypress((mc,) + size[1:], key)
  File "/Library/Python/2.7/site-packages/pudb/ui_tools.py", line 96, in keypress
    result = self._w.keypress(size, key)
  File "/Library/Python/2.7/site-packages/urwid/container.py", line 1587, in keypress
    key = self.focus.keypress(tsize, key)
  File "/Library/Python/2.7/site-packages/urwid/container.py", line 1587, in keypress
    key = self.focus.keypress(tsize, key)
  File "/Library/Python/2.7/site-packages/pudb/ui_tools.py", line 96, in keypress
    result = self._w.keypress(size, key)
  File "/Library/Python/2.7/site-packages/urwid/listbox.py", line 1001, in keypress
    return actual_key(self._keypress_down((maxcol, maxrow)))
  File "/Library/Python/2.7/site-packages/urwid/listbox.py", line 1136, in _keypress_down
    row_offset-rows)
  File "/Library/Python/2.7/site-packages/urwid/listbox.py", line 782, in shift_focus
    raise ListBoxError, "Invalid offset_inset: %r, only %r rows in target!" %(offset_inset, tgt_rows)
ListBoxError: Invalid offset_inset: -1, only 1 rows in target!

Running macOS, but as far as I remember it reproduced on Linux too.

volo-zyko avatar Sep 01 '17 14:09 volo-zyko

That looks like it hits a corner case in urwid--could you ask on their bug tracker?

All pudb does is build a Pile of ListBoxes with the "weights" adjusted by [/]:

https://github.com/inducer/pudb/blob/master/pudb/debugger.py#L692

inducer avatar Sep 01 '17 15:09 inducer

@volo-zyko - could you please check if this happens only with the latest release (2017.1.3) or it also happens with the previous one (2017.1.3)? I'm facing a similar issue (will submit an issue shortly) which goes away when going back one version.

cdman avatar Sep 02 '17 11:09 cdman

It definitely reproduced with 2017.1.2 (if you mean it) and given that the last urwid release was in November 2015, I've been facing this issue maybe for a year or more (I don't remember exactly when it happened first).

volo-zyko avatar Sep 02 '17 17:09 volo-zyko

Thank you for checking it. The it (unfortunately) means that it's a different issue from mine :(

cdman avatar Sep 04 '17 05:09 cdman