Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception diffing files with processing instructions #78

Open
gnarlyfarley opened this issue Jun 28, 2021 · 2 comments
Open

Exception diffing files with processing instructions #78

gnarlyfarley opened this issue Jun 28, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@gnarlyfarley
Copy link

xmldiff_error.zip

When diffing the two files contained in the attached zip file, I get the following exception:

Traceback (most recent call last):
File "", line 1, in
File "C:\Users\lafarley\AppData\Local\Programs\Python\Python36\lib\site-packages\xmldiff\main.py", line 51, in diff_files
diff_options=diff_options, formatter=formatter)
File "C:\Users\lafarley\AppData\Local\Programs\Python\Python36\lib\site-packages\xmldiff\main.py", line 39, in _diff
formatter=formatter)
File "C:\Users\lafarley\AppData\Local\Programs\Python\Python36\lib\site-packages\xmldiff\main.py", line 28, in diff_trees
return list(diffs)
File "C:\Users\lafarley\AppData\Local\Programs\Python\Python36\lib\site-packages\xmldiff\diff.py", line 439, in diff
for action in self.update_node_tag(lnode, rnode):
File "C:\Users\lafarley\AppData\Local\Programs\Python\Python36\lib\site-packages\xmldiff\diff.py", line 233, in update_node_tag
left.tag = right.tag
File "src\lxml\etree.pyx", line 992, in lxml.etree._Element.tag.set
File "src\lxml\apihelpers.pxi", line 1657, in lxml.etree._getNsTag
File "src\lxml\apihelpers.pxi", line 1675, in lxml.etree.__getNsTag
File "src\lxml\apihelpers.pxi", line 1538, in lxml.etree._utf8
TypeError: Argument must be bytes or unicode, got 'cython_function_or_method'

@regebro regebro added the enhancement New feature or request label Jan 11, 2023
@regebro
Copy link
Contributor

regebro commented Jan 11, 2023

We currently do not support XML Processing instructions. We should.

@regebro
Copy link
Contributor

regebro commented Jan 13, 2023

Investigating a bit, diffing does work, but the xml formatter fails. To fix this we likely do have to handle processing instructions differently in the diffing itself, specifically we should never rename a normal node to a processing instruction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants