[Urwid] [bugreport] container.py
ian at excess.org
Sun Dec 11 15:33:53 EST 2011
Patrick Totzke wrote on 2011-12-11 15:18:
> Quoting Ian Ward (2011-12-11 20:12:54)
>> Patrick Totzke wrote on 2011-12-11 15:06:
>>> Quoting Ian Ward (2011-12-11 19:58:40)
>>>> Patrick Totzke wrote on 2011-12-11 14:48:
>>>>> Hi, I just got an uncaught UnboundLocalError from container.py:
>>>> So it looks like you have a Pile that contains no widgets, and yet
>>>> move_cursor_to_coords is still being called on it, like it's about to
>>>> take the focus. I guess that could happen if your ListBox has no
>>>> selectable widgets in it, but I'm wondering if there will be other
>>>> problems with having a 0-height focus widget.
>>> not that i'm aware of. i'll check this.
>>>> try adding:
>>>> else: return False
>>>> after the for loop, container.py line 1001. And let me know if things
>>>> continue on any further for you.
>>> I tried the changes like the patch below suggests,
>>> but the problem still exists.
>> Sorry, this is what I meant:
>> --- a/urwid/container.py Tue Nov 29 00:31:45 2011 -0500
>> +++ b/urwid/container.py Sun Dec 11 15:12:11 2011 -0500
>> @@ -998,6 +998,8 @@
>> if wrow+r > row:
>> wrow += r
>> + else:
>> + return False
>> if not w.selectable():
>> return False
> This gives the following trace for me.
An empty Pile in a ListBox seems to be a rich veign of bugs. It's the
sort of thing that's easy to make tests for, though. Do you have a
minimal example that causes this for you?
In my first try I made ListBox die too, but in a different way:
I'll start writing some tests.
More information about the Urwid