ValueError: Unknown diff format due to wrong encoding of diff
slamer59 opened this issue · comments
On windows with Powershell,
I took for the exemple insert-node.left.xml
xmldiff .\insert-node.left.xml .\insert-node.right.xml > insert-gen.diff
This lead on my machine to UTF 16 with BOM which is not read by xmlpatch
xmlpatch.exe .\insert-gen.diff .\insert-node.left.xml
gives : ValueError: Unknown diff format
This error is raised here:
Line 207 in c6f2e88
and can be fixed by #80
This might work too:
print(result.encode('utf-8'))
Aha, so your console is in UTF-16. I have added a --diff-encoding
parameter to xmldiff
, which will be included in v2.5.