urwid 2.6.4-1 exception when rendering an empty Pile or Columns as a flow widget

Bug #2058388 reported by Olivier Gayot
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
subiquity
Invalid
Undecided
Unassigned
urwid (Debian)
Fix Released
Unknown
urwid (Ubuntu)
Fix Released
Undecided
Olivier Gayot

Bug Description

When attempting to render an empty Pile or Columns as a flow widget using urwid 2.6.4-1, it fails with the following exception:

  File "/usr/lib/python3/dist-packages/urwid/widget/widget.py", line 112, in cached_render
    canv = fn(self, size, focus=focus)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urwid/widget/pile.py", line 822, in render
    _widths, heights, size_args = self.get_rows_sizes(size, focus)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urwid/widget/pile.py", line 730, in get_rows_sizes
    heights.append(w.pack(w_h_arg, item_focus)[1])
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urwid/widget/pile.py", line 744, in pack
    return super().pack(size, focus)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/urwid/widget/widget.py", line 401, in pack
    raise WidgetError(f"Cannot pack (maxcol,) size, this is not a flow widget: {self!r}")
urwid.widget.widget.WidgetError: Cannot pack (maxcol,) size, this is not a flow widget: <Pile widget>

Minimal code to reproduce:

```python
from urwid import Pile

Pile([
    ("pack", Pile([])),
]).render((10,))
```

This looks like a regression in 2.6.4-1 since the same code was not failing on 2.1.2-4

There is an upstream fix [1] that is released in urwid 2.6.5.

 https://github.com/urwid/urwid/pull/843

Olivier Gayot (ogayot)
Changed in subiquity:
status: New → Invalid
Changed in urwid (Ubuntu):
assignee: nobody → Olivier Gayot (ogayot)
status: New → In Progress
Olivier Gayot (ogayot)
summary: - urwid 2.6.4-1 exception when drawing an empty Pile or Columns
+ urwid 2.6.4-1 exception when using an empty Pile or Columns as a flow
+ widget
description: updated
summary: - urwid 2.6.4-1 exception when using an empty Pile or Columns as a flow
- widget
+ urwid 2.6.4-1 exception when rendering an empty Pile or Columns as a
+ flow widget
Revision history for this message
Olivier Gayot (ogayot) wrote :

Adding debdiff. The updated package is available in ppa:ogayot/noble-proposed

https://launchpad.net/~ogayot/+archive/ubuntu/noble-proposed/+packages

Revision history for this message
Olivier Gayot (ogayot) wrote :
Changed in urwid (Debian):
status: Unknown → New
Revision history for this message
Benjamin Drung (bdrung) wrote :

Sponsored upload.

Changed in urwid (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package urwid - 2.6.4-1ubuntu1

---------------
urwid (2.6.4-1ubuntu1) noble; urgency=medium

  * Apply upstream patch to fix a crash when rendering an empty Pile or an
    empty Columns as a flow widget. (LP: #2058388)
    + d/patches/fix-crash-empty-pile.patch

 -- Olivier Gayot <email address hidden> Fri, 22 Mar 2024 14:59:22 +0100

Changed in urwid (Ubuntu):
status: Fix Committed → Fix Released
Changed in urwid (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.