[reportlab-users] Bug in Paragraph class with tags when switching frames

Robin Becker robin at reportlab.com
Fri Nov 16 06:21:02 EST 2007


Dinu Gherman wrote:

> Robin Becker:

>

>> Dinu can you please say what the issue is? Is it with Henning's

>> extension or with the base reportlab code. I have fixed two issues

>> related to your report, but only in SVN. If you're still seeing a

>> problem with the latest code can you resubmit a bug?

>

> Ok, I've replaced RL-2.1 with RL-SVN and the Donau sample renders fine,

> but my main document builder generates now the traceback below. I cannot

> quickly strip this down to sample code size, since I don't have the time,

> but maybe the traceback already gives you an idea of the error. If you

> need more data, please let me know. (There is no hyphenation involved,

> BTW.)

>

> Regards,

>

> Dinu

>

>

> Traceback (most recent call last):

> File "test.py", line 580, in <module>

> main(path)

> File "test.py", line 570, in main

> doc.multiBuild(story)

> File

> "/usr/local/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py",

> line 829, in multiBuild

> self.canv.save()

> File

> "/usr/local/lib/python2.5/site-packages/reportlab/pdfgen/canvas.py",

> line 879, in save

> self._doc.SaveToFile(self._filename, self)

> File

> "/usr/local/lib/python2.5/site-packages/reportlab/pdfbase/pdfdoc.py",

> line 219, in SaveToFile

> f.write(self.GetPDFData(canvas))

> File

> "/usr/local/lib/python2.5/site-packages/reportlab/pdfbase/pdfdoc.py",

> line 241, in GetPDFData

> return self.format()

> File

> "/usr/local/lib/python2.5/site-packages/reportlab/pdfbase/pdfdoc.py",

> line 384, in format

> IOf = IO.format(self)

> File

> "/usr/local/lib/python2.5/site-packages/reportlab/pdfbase/pdfdoc.py",

> line 821, in format

> fcontent = format(content, document, toplevel=1) # yes this is at

> top level

> File

> "/usr/local/lib/python2.5/site-packages/reportlab/pdfbase/pdfdoc.py",

> line 95, in format

> f = element.format(document)

> File

> "/usr/local/lib/python2.5/site-packages/reportlab/pdfbase/pdfdoc.py",

> line 1560, in format

> return D.format(document)

> File

> "/usr/local/lib/python2.5/site-packages/reportlab/pdfbase/pdfdoc.py",

> line 621, in format

> L = [(format(PDFName(k),document)+" "+format(dict[k],document)) for

> k in keys]

> File

> "/usr/local/lib/python2.5/site-packages/reportlab/pdfbase/pdfdoc.py",

> line 95, in format

> f = element.format(document)

> File

> "/usr/local/lib/python2.5/site-packages/reportlab/pdfbase/pdfdoc.py",

> line 1677, in format

> if f is None: raise ValueError, "format not resolved %s" % self.name

> ValueError: format not resolved

........

looks like there's a dictionary with an empty key. Can you just wrap the call at
line 621 thusly.

try:
L = [(format(PDFName(k),document)+" "+format(dict[k],document)) for k in keys]
except:
print ['%r=%r' %(k,v) for k,v in dict.items()]
raise

that may give some clue as to what kind of dictionary it is?

--
Robin Becker


More information about the reportlab-users mailing list