我在PDF生成时遇到异常。
这种情况有时并非总是如此。有时会发生第一个异常,有时会发生第二个异常。
以下是捕获问题的堆栈跟踪。几乎与Troubleshoot reportlab heisenbug
中为django确定的第一个例外相似但这似乎不适用于我的情况。
LINE_SEPARATOR_PATTERN = "\r\n|[\n\r\u2028\u2029\u0085]";
File "/home/openerp/clean_oe7/server/openerp/report/report_sxw.py", line 533, in create_single_pdf
pdf = create_doc(etree.tostring(processed_rml),rml_parser.localcontext,logo,title.encode('utf8'))
File "/home/openerp/clean_oe7/server/openerp/report/interface.py", line 206, in create_pdf
obj.render()
File "/home/openerp/clean_oe7/server/openerp/report/render/render.py", line 59, in render
self._result = self._render()
File "/home/openerp/clean_oe7/server/openerp/report/render/rml.py", line 41, in _render
return rml2pdf.parseNode(self.rml, self.localcontext, images=self.bin_datas, path=self.path,title=self.title)
File "/home/openerp/clean_oe7/server/openerp/report/render/rml2pdf/trml2pdf.py", line 1032, in parseNode
r.render(fp)
File "/home/openerp/clean_oe7/server/openerp/report/render/rml2pdf/trml2pdf.py", line 328, in render
pt_obj.render(el)
File "/home/openerp/clean_oe7/server/openerp/report/render/rml2pdf/trml2pdf.py", line 1003, in render
fis += r.render(node_story)
File "/home/openerp/clean_oe7/server/openerp/report/render/rml2pdf/trml2pdf.py", line 897, in render
return process_story(node_story)
File "/home/openerp/clean_oe7/server/openerp/report/render/rml2pdf/trml2pdf.py", line 890, in process_story
flow = self._flowable(node)
File "/home/openerp/clean_oe7/server/openerp/report/render/rml2pdf/trml2pdf.py", line 813, in _flowable
return self._table(node)
File "/home/openerp/clean_oe7/server/openerp/report/render/rml2pdf/trml2pdf.py", line 697, in _table
fl = self._flowable(n, extra_style=paraStyle)
File "/home/openerp/clean_oe7/server/openerp/report/render/rml2pdf/trml2pdf.py", line 766, in _flowable
result.append(platypus.Paragraph(i, style, **(utils.attr_get(node, [], {'bulletText':'str'}))))
File "/usr/lib/python2.7/dist-packages/reportlab/platypus/paragraph.py", line 827, in __init__
self._setup(text, style, bulletText, frags, cleanBlockQuotedText)
File "/usr/lib/python2.7/dist-packages/reportlab/platypus/paragraph.py", line 842, in _setup
style, frags, bulletTextFrags = _parser.parse(text,style)
File "/usr/lib/python2.7/dist-packages/reportlab/platypus/paraparser.py", line 1058, in parse
return self._complete_parse()
File "/usr/lib/python2.7/dist-packages/reportlab/platypus/paraparser.py", line 1061, in _complete_parse
del self._seq
AttributeError: ParaParser instance has no attribute '_seq'