pazz/alot — Issue #150: urwid container bug
Author: pazz
Created: 2011-12-12 17:20:38+00:00
State: open
Labels: bug

happens if you have a long bodytext in an envelope,
scroll down and scroll up again using the keys or `k` (not pageup).
already reported on the urwid list: http://lists.excess.org/pipermail/urwid/2011-December/001161.html
added here for completeness sake..

```

Traceback (most recent call last):
File "/usr/local/bin/alot", line 20, in
main()
File "/usr/local/lib/python2.7/dist-packages/alot/init.py", line 102, in main
args.colours,
File "/usr/local/lib/python2.7/dist-packages/alot/ui.py", line 111, in __init__
self.mainloop.run()
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/main_loop.py", line 271, in run
self.screen.run_wrapper(self._run)
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/raw_display.py", line 228, in run_wrapper
return fn()
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/main_loop.py", line 292, in _run
self.event_loop.run()
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/main_loop.py", line 1144, in wrapper
rval = f(*args,**kargs)
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/main_loop.py", line 343, in _update
self.process_input(keys)
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/main_loop.py", line 432, in process_input
k = self._topmost_widget.keypress(self.screen_size, k)
File "/usr/local/lib/python2.7/dist-packages/alot/ui.py", line 56, in keypress
return self._w.keypress(size, key)
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/container.py", line 631, in keypress
return self.body.keypress( (maxcol, remaining), key )
File "/usr/local/lib/python2.7/dist-packages/alot/buffers.py", line 34, in keypress
return self.body.keypress(size, key)
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/listbox.py", line 768, in keypress
return self._keypress_up((maxcol, maxrow))
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/listbox.py", line 830, in _keypress_up
row_offset, 'below')
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/listbox.py", line 692, in change_focus
if target.move_cursor_to_coords((maxcol,),pref_col,row):
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/container.py", line 992, in move_cursor_to_coords
if not w.selectable():
UnboundLocalError: local variable 'w' referenced before assignment

```