#189 rst2pdf crashes in spanFixDim()

closed-rejected
nobody
None
5
2012-09-03
2012-04-18
James Hunt
No

I have a large rst document [1] which passes through 'rst2html --strict' correctly but which fails with rst2pdf:

rst2pdf -o /tmp/upstart_cookbook.pdf /tmp/upstart_cookbook.rst
Traceback (most recent call last):
File "/usr/bin/rst2pdf", line 9, in <module>
load_entry_point('rst2pdf==0.16', 'console_scripts', 'rst2pdf')()
File "/usr/lib/pymodules/python2.7/rst2pdf/createpdf.py", line 1456, in main
compressed=options.compressed)
File "/usr/lib/pymodules/python2.7/rst2pdf/createpdf.py", line 666, in createPdf
pdfdoc.multiBuild(elements)
File "/usr/lib/python2.7/dist-packages/reportlab/platypus/doctemplate.py", line 960, in multiBuild
self.build(tempStory, **buildKwds)
File "/usr/lib/python2.7/dist-packages/reportlab/platypus/doctemplate.py", line 880, in build
self.handle_flowable(flowables)
File "/usr/lib/pymodules/python2.7/rst2pdf/createpdf.py", line 774, in handle_flowable
if frame.add(f, canv, trySplit=self.allowSplitting):
File "/usr/lib/pymodules/python2.7/rst2pdf/flowables.py", line 555, in add
return Frame.add(self, flowable, canv, trySplit)
File "/usr/lib/python2.7/dist-packages/reportlab/platypus/frames.py", line 159, in _add
w, h = flowable.wrap(aW, h)
File "/usr/lib/pymodules/python2.7/rst2pdf/flowables.py", line 233, in wrap
return self.t.wrap(w, h)
File "/usr/lib/python2.7/dist-packages/reportlab/platypus/tables.py", line 1113, in wrap
self._calc(availWidth, availHeight)
File "/usr/lib/python2.7/dist-packages/reportlab/platypus/tables.py", line 587, in _calc
self._calc_height(availHeight,availWidth,W=W)
File "/usr/lib/python2.7/dist-packages/reportlab/platypus/tables.py", line 553, in _calc_height
spanFixDim(H0,H,spanCons,lim=hmax)
File "/usr/lib/python2.7/dist-packages/reportlab/platypus/tables.py", line 205, in spanFixDim
t = sum([V[x]+M.get(x,0) for x in xrange(x0,x1)])
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

$ dpkg -l |grep docutils|awk '{print $2, $3}'
docutils-common 0.8.1-4ubuntu1
docutils-doc 0.8.1-4ubuntu1
python-docutils 0.8.1-4ubuntu1
$

[1] - http://bazaar.launchpad.net/~upstart-documenters/upstart-cookbook/trunk/view/head:/upstart_cookbook.rst

Discussion

  • rst2pdf is a separate project.

     
  • Günter Milde
    Günter Milde
    2012-09-03

    • status: open --> closed-rejected