Thanks to visit codestin.com
Credit goes to github.com

Skip to content

IndexError: list index out of range #125

@ZeroDevNull

Description

@ZeroDevNull

OS: Ubuntu 20.04
XMLDIFF version: 2.4/2.6.3

When I diff these two files I get the following error:

Traceback (most recent call last):
  File "/data/usr/bin/xmlpatch", line 11, in <module>
    load_entry_point('xmldiff==2.4', 'console_scripts', 'xmlpatch')()
  File "/data/usr/lib/python3/dist-packages/xmldiff/main.py", line 171, in patch_command
    result = patch_file(args.patchfile, args.xmlfile)
  File "/data/usr/lib/python3/dist-packages/xmldiff/main.py", line 148, in patch_file
    tree = patch_tree(actions, tree)
  File "/data/usr/lib/python3/dist-packages/xmldiff/main.py", line 124, in patch_tree
    return patcher.patch(actions, tree)
  File "/data/usr/lib/python3/dist-packages/xmldiff/patch.py", line 15, in patch
    self.handle_action(action, result)
  File "/data/usr/lib/python3/dist-packages/xmldiff/patch.py", line 22, in handle_action
    method(action, tree)
  File "/data/usr/lib/python3/dist-packages/xmldiff/patch.py", line 34, in _handle_RenameNode
    tree.xpath(action.node)[0].tag = action.tag
IndexError: list index out of range

The commands I run are:
xmldiff cfgspawnabletypes1.xml cfgspawnabletypes2.xml > cfgspawnabletypes.diff
xmlpatch cfgspawnabletypes.diff cfgspawnabletypes1.xml

The exact files used:
xmltest.zip

I've tried to remove all whitepaces and comments but that didn't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions