Georgiy Ishchenko
unread,Oct 20, 2025, 4:43:40 AMOct 20Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to reportlab-users
Summary
When a Table triggers a ValueError due to negative availWidth inside _listCellGeom, the error formatting calls Table.identity(), which computes the “tallest row” via int(max(rh)). If rh contains None, this raises a secondary TypeError (int() on NoneType), masking the original and more helpful ValueError.
Affected version
- ReportLab: 4.4.4 (4.4.3 does well)
- Python: 3.13 / 3.14 (reproduced with both)
- OS: macOS
Observed stack (paths redacted)
File ".../reportlab/platypus/doctemplate.py", line 1170, in multiBuild
self.build(tempStory, **buildKwds)
File ".../reportlab/platypus/doctemplate.py", line 1083, in build
self.handle_flowable(flowables)
File ".../rst2pdf/createpdf.py", line 836, in handle_flowable
S = frame.split(f, canv)
File ".../reportlab/platypus/frames.py", line 235, in split
r = flowable.split(self._aW, h)
File ".../rst2pdf/flowables.py", line 408, in split
_w, _h = first_t.wrap(w, h)
File ".../reportlab/platypus/tables.py", line 1354, in wrap
self._calc(availWidth, availHeight)
File ".../reportlab/platypus/tables.py", line 740, in _calc
self._calc_height(availHeight,availWidth,W=W)
File ".../reportlab/platypus/tables.py", line 664, in _calc_height
dW,t = self._listCellGeom(v,w or self._listValueWidth(v),s)
File ".../reportlab/platypus/tables.py", line 490, in _listCellGeom
raise ValueError(f'{self.identity()}: flowable given negative availWidth=...')
File ".../reportlab/platypus/tables.py", line 440, in identity
tallest = '(tallest row %d)' % int(max(rh))
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
Notes
- Reproduced via rst2pdf, but the failure is inside ReportLab’s platypus.tables.
- Local paths/usernames were redacted to avoid leaking environment details.