xhtml to odt fails for empty tables

Bug #1171498 reported by Murithi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Appy
Undecided
Gaëtan Delannay

Bug Description

Exception when generating odt from an empty table -
Sample markup: <table><tbody></tbody></table>

Error while evaluating the expression "xhtml(body_text)" defined in the "from" part of a statement.
File "<string>", line 1, in <module>
File "/opt/local_py/local_py_apps/local_py/eggs/appy-0.8.3-py2.7.egg/appy/pod/renderer.py", line 257, in renderXhtml
stylesMapping, self).run()
File "/opt/local_py/local_py_apps/local_py/eggs/appy-0.8.3-py2.7.egg/appy/pod/xhtml2odt.py", line 632, in run
self.xhtmlParser.parse(self.xhtmlString)
File "/opt/local_py/local_py_apps/local_py/eggs/appy-0.8.3-py2.7.egg/appy/shared/xml_parser.py", line 245, in parse
self.parser.parse(inputSource)
File "/opt/local_py/local_py_apps/python27/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/opt/local_py/local_py_apps/python27/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/opt/local_py/local_py_apps/python27/lib/python2.7/xml/sax/expatreader.py", line 207, in feed
self._parser.Parse(data, isFinal)
File "/opt/local_py/local_py_apps/python27/lib/python2.7/xml/sax/expatreader.py", line 304, in end_element
self._cont_handler.endElement(name)
File "/opt/local_py/local_py_apps/local_py/eggs/appy-0.8.3-py2.7.egg/appy/pod/xhtml2odt.py", line 590, in endElement
currentElem, elemsToReopen = e.onElementEnd(elem)
File "/opt/local_py/local_py_apps/local_py/eggs/appy-0.8.3-py2.7.egg/appy/pod/xhtml2odt.py", line 480, in onElementEnd
table.computeColumnStyles(self.parser.caller.renderer)
File "/opt/local_py/local_py_apps/local_py/eggs/appy-0.8.3-py2.7.egg/appy/pod/xhtml2odt.py", line 275, in computeColumnStyles
widths = [int(total/self.nbOfColumns)] * self.nbOfColumns
<type 'exceptions.ZeroDivisionError'>: float division by zero

Changed in appy:
milestone: none → 0.9.3
status: New → Fix Committed
Changed in appy:
status: Fix Committed → Fix Released
assignee: nobody → Gaëtan Delannay (gaetan-delannay)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers