You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed when editing with openpyxl some sub files are lost. The whole customXml folder is deleted. Which then gives the following error.
opc diff input.xlsx output.xlsx
Traceback (most recent call last):
File "/usr/local/bin/opc", line 8, in
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.12/site-packages/opcdiag/cli.py", line 309, in main
command_controller.execute(argv)
File "/usr/local/lib/python3.12/site-packages/opcdiag/cli.py", line 54, in execute
command.execute(args, self._app_controller)
File "/usr/local/lib/python3.12/site-packages/opcdiag/cli.py", line 147, in execute
app_controller.diff_pkg(args.pkg_1_path, args.pkg_2_path)
File "/usr/local/lib/python3.12/site-packages/opcdiag/controller.py", line 58, in diff_pkg
rels_diffs = DiffPresenter.rels_diffs(package_1, package_2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/opcdiag/presenter.py", line 120, in rels_diffs
return DiffPresenter._pkg_item_diffs(package_1_rels_items, package_2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/opcdiag/presenter.py", line 155, in _pkg_item_diffs
pkg_item_2 = package_2.find_item_by_uri_tail(uri)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/opcdiag/model.py", line 47, in find_item_by_uri_tail
raise KeyError("No item with name '%s'" % uri_tail)
KeyError: "No item with name 'customXml/_rels/item1.xml.rels'"
The text was updated successfully, but these errors were encountered:
Can you provide a pair of files that reproduces this behavior?
Offhand it looks like opc-diag is not sophisticated enough to handle diffs between items where whole package parts (zip-archive "files") have been deleted.
Maybe you could open and save the file with openpyxl without making changes as a first step, which might drop the customXml part then make changes to the worksheet and use opcdiag on those latter two versions.
I noticed when editing with openpyxl some sub files are lost. The whole customXml folder is deleted. Which then gives the following error.
The text was updated successfully, but these errors were encountered: