IndexError when Diffing content.xml from ODT

Bug #179643 reported by Brian Pitts
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
xmldiff (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: xmldiff

[append-first, /,
Traceback (most recent call last):
  File "/usr/bin/xmldiff", line 4, in <module>
    main.run()
  File "/usr/lib/python2.5/site-packages/xmldiff/main.py", line 256, in run
    encoding, html)
  File "/usr/lib/python2.5/site-packages/xmldiff/main.py", line 118, in process_files
    strategy.process_trees(tree1, tree2)
  File "/usr/lib/python2.5/site-packages/xmldiff/fmes.py", line 104, in process_trees
    self._formatter.end()
  File "/usr/lib/python2.5/site-packages/xmldiff/format.py", line 80, in end
    self.format_action(action)
  File "/usr/lib/python2.5/site-packages/xmldiff/format.py", line 105, in format_action
    xml_print(action[A_N2])
  File "/usr/lib/python2.5/site-packages/xmldiff/objects.py", line 180, in xml_print
    _xml_print_internal_format(node, indent, stream)
  File "/usr/lib/python2.5/site-packages/xmldiff/objects.py", line 191, in _xml_print_internal_format
    n[N_CHILDS][0][N_VALUE])
IndexError: list index out of range

Revision history for this message
Brian Pitts (bpitts) wrote :
Revision history for this message
Brian Pitts (bpitts) wrote :
Revision history for this message
Guillaume Desmottes (cassidy) wrote :

Got that crash too when trying to use xmldiff.

Changed in xmldiff:
status: New → Confirmed
Revision history for this message
Tom Rowlands (tom-rowlands) wrote :

What appears to be the same bug is triggered even with very simple input. No difference is detected between:

<testfile/>

and

<testfile>
</testfile>

Faulty behaviour, possibly the same bug, is triggered whenever there is more than one element in the file, not including the XML declaration. (That comment is for clarity; formally the declaration may not be considered an element.) Consequently, the following is also considered the same as both the above by the broken xmldiff:

<?xml version="1.0" encoding="UTF-8"?>
<testfile>
</testfile>

However, the xmldiff is used to compare:

<t><q/></t>

with

<t><q></q></t>

it returns that the files are logically different and that the following is the difference:

<?xml version="1.0"?>
<xupdate:modifications xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
  <xupdate:append select="/" child="first()">
    <xupdate:element name="t"> </xupdate:element>
  </xupdate:append>
  <xupdate:remove select="/t[2]/q[1]"/>
  <xupdate:append select="/t[1]">
    <xupdate:element name="q"> </xupdate:element>
  </xupdate:append>
  <xupdate:remove select="/t[2]"/>
</xupdate:modifications>

Revision history for this message
Lincoln Stoll (lstoll) wrote :

A quick test shows this is related to python 2.6 - if xmldiff is run with python2.5 (e.g /usr/bin/python2.5 /usr/bin/xmldiff bwah) it works.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.