[reportlab-users] Wordaxe 0.3.0, ReportLab 2.2, MultiBuild and splitting error

Henning von Bargen H.vonBargen at t-p.com
Tue Nov 18 12:39:09 EST 2008

Thanks for your bug report, Harald.
I added it as item 2310279 to the wordaxe bug tracker at
Can you perhaps create a simple test case?


> From: "Harald Armin Massa" <haraldarminmassa at gmail.com>

> Subject: Wordaxe 0.3.0, ReportLab 2.2,MultiBuild and splitting error


> Hello,


> on updating some projekt to RL 2.2; and wordaxe 0.3.0, I ran into some

> obscure wrapping / splitting bug.


> As it turned out:


> the SplitRoutine within NewParagraph get's problems when

> doc.multibuild is used.


> I tracked it down to:


> if not hasattr(self, "_lines"):

> # This can only happen when split has been called

> # without a previous wrap for this Paragraph.

> # From looking at doctemplate.py and frames.py,

> # I assume this is only the case if the free space

> # in the frame is not even enough for getSpaceBefore.

> # Thus we can safely return []

> #~ print "split without previous wrap"

> return []


> NewParagraph of Wordaxe relying on self._lines NOT being present when

> there was no "wrap" in the actual build pass, to return "I cannot

> split"


> BUT...


> in a multibuild, in the second build pass that self._lines is present

> from the first build pass ... , and _unused is an empty list (as some

> wraps from the build pass before have used up everything)


> So MY fix was in doctemplate multibuild:


> #clean up so multi-build does not go wrong - the frame

> #packer might have tacked an attribute onto some flowables

> for elem in story:

> if hasattr(elem, '_postponed'):

> del elem._postponed

> if hasattr(elem, '_lines'):

> del elem._lines


> to extend the "cleanup" part to also delete the _lines attribute of a

> NewParagraph; together with the _postponed attribut.


> So everything works fine ... but I am not sure if this is really the

> best approach, and the NewParagraph split/wrap is quite to challenging

> to really be sure.


> That's why I am posting this fix for others to enjoy and for more

> enlightened ones to check:)


> Harald

More information about the reportlab-users mailing list