[reportlab-users] error in tables.py (rl 1.21.2)

William Dode wilk at flibuste.net
Fri Aug 8 10:35:59 EDT 2008


Hi,

Could you reproduce this bug ? I switched to reportlab 2.1 (debian
lenny) and it's still present.



> from reportlab.platypus import BaseDocTemplate, Frame, Paragraph, NextPageTemplate, PageBreak, PageTemplate, Spacer, KeepTogether, Flowable

> from reportlab.lib.pagesizes import A4, landscape, portrait, cm

> from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle

> from reportlab.lib.enums import TA_LEFT, TA_CENTER

> from reportlab.lib import colors

> from reportlab.platypus.tables import TableStyle, LongTable, Table

> f=open('/tmp/t.pdf','w')

> frame = Frame(2 * cm, 2 * cm , A4[0] - 4 * cm, A4[1] - 6*cm)

> doc = BaseDocTemplate(f, pagesize=A4)

> doc.addPageTemplates(PageTemplate('i',frame))

> style_para = getSampleStyleSheet()['Normal']

> style_para.spaceAfter = 12

>

> elements = []

> for z in (3,6,3,5,12,7,3,4,6,3,8):

> elements.append( Paragraph('toto',style_para))

> elements.append(LongTable([('x') for x in range(z)], repeatRows=1))

>

> doc.build(elements)


File "/usr/lib/python2.5/site-packages/reportlab/platypus/tables.py", line 1139, in _getFirstPossibleSplitRowPosition
if h+rh>availHeight:
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'


bye

--
William Dodé - http://flibuste.net
Informaticien Indépendant



More information about the reportlab-users mailing list