[reportlab-users] Crashing when table goes over a page

David Fraser reportlab-users@reportlab.com
Mon, 28 Jul 2003 13:26:16 +0200


Garth Kidd wrote:

>>>My problem is that the Apache script I'm writing becomes non 
>>>responsive if the data I try to put into a table goes over a page.
>>>      
>>>
>>I'm seeing the same thing here, with Python consuming as much
>>CPU and memory as it can get (I had to terminate it when it 
>>hit 512MB). Setting table.canSplit doesn't help. 
>>    
>>
>
>Below is the smallest code with which I can reproduce the problem. It's
>surprisingly fragile around the string in the fourth column; even changing
>POWER_SUPPLY_DEGRADED to PPPPP_SUPPLY_DEGRADED prevents the problem from
>occurring. 
>
>Can anyone more familiar with the ReportLab engine nut this one out? I don't
>understand ReportLab internals enough to figure it out in the debugger.
>
>Regards,
>Garth.
>
Thanks very much for the example, just wanted to confirm that this is 
reproducible here, using Reportlab 1.18 on Linux with Python2.2
After the thing hit 32MB I interupted it with the keyboard, and got the 
following:
Warn: Python Imaging Library not available
Building tableOfDoom-5.pdf (Table of Doom with 5 rows)...
Building tableOfDoom-10.pdf (Table of Doom with 10 rows)...
Building tableOfDoom-15.pdf (Table of Doom with 15 rows)...
Building tableOfDoom-20.pdf (Table of Doom with 20 rows)...
Building tableOfDoom-25.pdf (Table of Doom with 25 rows)...
Building tableOfDoom-30.pdf (Table of Doom with 30 rows)...
Building tableOfDoom-35.pdf (Table of Doom with 35 rows)...
Building tableOfDoom-40.pdf (Table of Doom with 40 rows)...
Traceback (most recent call last):
File "plattest.py", line 26, in ?
buildTableOfDoom(rows)
File "plattest.py", line 22, in buildTableOfDoom
doc.build([tableOfDoom(rows)])
File 
"/usr/lib/python2.2/site-packages/reportlab/platypus/doctemplate.py", 
line 765, in build
BaseDocTemplate.build(self,flowables)
File 
"/usr/lib/python2.2/site-packages/reportlab/platypus/doctemplate.py", 
line 607, in build
self.handle_flowable(flowables)
File 
"/usr/lib/python2.2/site-packages/reportlab/platypus/doctemplate.py", 
line 546, in handle_flowable
message = "Flowable %s too large on page %d" % (f.identity(30), self.page)
File "/usr/lib/python2.2/site-packages/reportlab/platypus/tables.py", 
line 192, in identity
if t in _SeqTypes or isinstance(v,Flowable):
KeyboardInterrupt

Hope that might help point to where the problem is

David