[reportlab-users] Error generating a document in Reportlab 2.1, Python2.5

Andy Robinson andy at reportlab.com
Tue Oct 9 13:33:42 EDT 2007

Mike, since you are a commercial customer and this list is broadcast to hundreds of open source users worldwide, it's better if you directly email the RML to "support at reportlab.com". The UK day has ended but we will look at it tomorrow morning.

- Andy Robinson

Andy Robinson
CEO/Chief Architect
ReportLab Europe Ltd.
tel +44-20-8544-8049

-----Original Message-----
From: Mike Steder <michael.steder at texturallc.com>
Date: Tue, 09 Oct 2007 12:06:35
To:reportlab-users at reportlab.com
Subject: [reportlab-users] Error generating a document in Reportlab 2.1,

Hello All,

I recently upgraded from Python2.4 and Reportlab 1.2 to Python2.5 and
Reportlab 2.1. I'm unable to generate documents due to the following
rml2pdf.go(rml, verbose=0, ignoreDefaults=0, outputFileName=outfile)
File "rlextra/rml2pdf/rml2pdf.py", line 4521, in go
File "/usr/local/lib/reportlab_2_1/reportlab/platypus/doctemplate.py",
line 740, in build
File "/usr/local/lib/reportlab_2_1/reportlab/platypus/doctemplate.py",
line 638, in handle_flowable
if frame.add(f, self.canv, trySplit=self.allowSplitting):
File "/usr/local/lib/reportlab_2_1/reportlab/platypus/frames.py", line
141, in _add
w, h = flowable.wrap(aW, h)
File "rlextra/rml2pdf/rml2pdf.py", line 2830, in wrap
File "/usr/local/lib/reportlab_2_1/reportlab/platypus/paragraph.py",
line 569, in wrap
self.blPara = self.breakLines([first_line_width, later_widths])
File "/usr/local/lib/reportlab_2_1/reportlab/platypus/paragraph.py",
line 672, in breakLines
nFrags= len(frags)
TypeError: object of type 'NoneType' has no len()

rml2pdf fails with the same error.

At this point I'm at a loss as to how to further debug or diagnose the
problem. I've run the unittests for both Reportlab and Rlextra and all
tests appear to run successfully. The exception makes it look like a
problem with my RML although the same document appears to generate
correctly using Reportlab 1.21 on Python 2.4.

Any information about how to fix or to further diagnose this problem
would be greatly appreciated. I've append some
information about my system and the output of rl_check.py.

I could attach the RML that I'm running rml2pdf on but it's 95KB or so and
violates the maximum message size for the list.

~Mike Steder
Textura LLC

uname -a:
Linux msteder.texturallc.net 2.6.22-13-generic #1 SMP Thu Oct 4 17:52:26
GMT 2007 x86_64 GNU/Linux

Python 2.5.1 (r251:54863, Oct 5 2007, 13:50:07)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2

rl_check.py returns:
msteder at msteder:~/Desktop$ python rl_check.py
ReportLab Health Check script

This will inspect your reportlab installations and help you
ensure they are correct, complete and up to date. If you don't
have reportlab's software installed, it will help you. It will
NOT modify anything at all, so you can run it safely at any time.

Python 2.5.1 (r251:54863, Sep 29 2007, 12:44:03)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)]
Executable: /usr/bin/python

1. ReportLab Toolkit - open source PDF library... version 2.1
(in /usr/local/lib/reportlab_2_1/reportlab/__init__.pyc)

2. _rl_accel extension module... found version 0.61
(in /usr/lib/python2.5/site-packages/_rl_accel.so)

3. Python Imaging Library... found
(in /usr/lib/python2.5/site-packages/PIL)

4. _renderPM extension module... found version 1.04
(in /usr/lib/python2.5/site-packages/_renderPM.so)

5. pyRXP xml parser... found version 1.12
(in /usr/lib/python2.5/site-packages/pyRXP.so)

5. ReportLab commercial package (rlextra)... found version 2.1
(in /usr/local/lib/rlextra_2_1/rlextra/__init__.pyc)

reportlab-users mailing list
reportlab-users at reportlab.com

More information about the reportlab-users mailing list