Skip to content

Incompatibility with >=libarchive-c-5.0

I get the following with libarchive-c-5.0:

$ diffoscope /var/cache/distfiles/lxml-4.9.3.gh.tar.gz._checksum_failure_.gqrib50a /tmp/lxml-4.9.3.gh.tar.gz 
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/diffoscope/diff.py", line 334, in diff
    with FIFOFeeder(feeder1, fifo1_path) as fifo1, FIFOFeeder(
  File "/usr/lib/python3.11/site-packages/diffoscope/diff.py", line 225, in __exit__
    self.join()
  File "/usr/lib/python3.11/site-packages/diffoscope/diff.py", line 258, in join
    raise self._exception
  File "/usr/lib/python3.11/site-packages/diffoscope/diff.py", line 249, in run
    end_nl = self.feeder(fifo)
             ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/diffoscope/feeders.py", line 79, in feeder
    for buf in in_file:
  File "/usr/lib/python3.11/site-packages/diffoscope/comparators/utils/libarchive.py", line 149, in list_libarchive
    user=entry.uname.decode(
         ^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/diffoscope/main.py", line 767, in main
    sys.exit(run_diffoscope(parsed_args))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/diffoscope/main.py", line 718, in run_diffoscope
    difference = compare_root_paths(path1, path2)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/diffoscope/comparators/utils/compare.py", line 69, in compare_root_paths
    difference = compare_files(file1, file2)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/diffoscope/comparators/utils/compare.py", line 149, in compare_files
    return file1.compare(file2, source)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/diffoscope/comparators/utils/file.py", line 515, in compare
    difference = self._compare_using_details(other, source)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/diffoscope/comparators/utils/file.py", line 450, in _compare_using_details
    details.extend(
  File "/usr/lib/python3.11/site-packages/diffoscope/comparators/utils/container.py", line 197, in compare_pair
    difference = compare_files(
                 ^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/diffoscope/comparators/utils/compare.py", line 149, in compare_files
    return file1.compare(file2, source)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/diffoscope/comparators/utils/file.py", line 515, in compare
    difference = self._compare_using_details(other, source)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/diffoscope/comparators/utils/file.py", line 416, in _compare_using_details
    details.extend(self.compare_details(other, source))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/diffoscope/comparators/tar.py", line 39, in compare_details
    Difference.from_text_readers(
  File "/usr/lib/python3.11/site-packages/diffoscope/difference.py", line 258, in from_text_readers
    return Difference.from_feeder(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/diffoscope/difference.py", line 214, in from_feeder
    unified_diff = diff(feeder1, feeder2)
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/diffoscope/diff.py", line 334, in diff
    with FIFOFeeder(feeder1, fifo1_path) as fifo1, FIFOFeeder(
  File "/usr/lib/python3.11/site-packages/diffoscope/diff.py", line 225, in __exit__
    self.join()
  File "/usr/lib/python3.11/site-packages/diffoscope/diff.py", line 258, in join
    raise self._exception
  File "/usr/lib/python3.11/site-packages/diffoscope/diff.py", line 249, in run
    end_nl = self.feeder(fifo)
             ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/diffoscope/feeders.py", line 79, in feeder
    for buf in in_file:
  File "/usr/lib/python3.11/site-packages/diffoscope/comparators/utils/libarchive.py", line 149, in list_libarchive
    user=entry.uname.decode(
         ^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'decode'

There's a pretty large list of testsuite failures too:

ERROR tests/test_quines.py::test_differences_deb - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
ERROR tests/comparators/test_archive.py::test_compressed_content_name - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
ERROR tests/comparators/test_deb.py::test_metadata - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
ERROR tests/comparators/test_deb.py::test_compressed_files - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
ERROR tests/comparators/test_deb.py::test_md5sums - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
ERROR tests/comparators/test_debian.py::test_dot_changes_identical_contents_and_different_files - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
ERROR tests/comparators/test_debian.py::test_dot_buildinfo_internal_diff - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
ERROR tests/comparators/test_elf.py::test_differences_with_dbgsym - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
ERROR tests/comparators/test_elf.py::test_original_gnu_debuglink - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
ERROR tests/comparators/test_ipk.py::test_metadata - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
ERROR tests/comparators/test_ipk.py::test_compressed_files - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
ERROR tests/comparators/test_pgp.py::test_signed_diff - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
ERROR tests/comparators/test_tar.py::test_listing - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
ERROR tests/comparators/test_tar.py::test_symlinks - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
ERROR tests/comparators/test_tar.py::test_text_file - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/test_diff_mask.py::test_none - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_diff_mask.py::test_all - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_diff_mask.py::test_specific - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_excludes.py::test_none - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_excludes.py::test_specific - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_excludes.py::test_specific_case - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_excludes.py::test_multiple - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_excludes.py::test_nomatch - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_excludes.py::test_wildcard - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_presenters.py::test_text_option_is_default - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_presenters.py::test_text_option_color - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_presenters.py::test_text_option_with_file - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_presenters.py::test_text_option_with_stdout - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_presenters.py::test_markdown - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_presenters.py::test_restructuredtext - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_presenters.py::test_json - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_presenters.py::test_no_report_option - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_presenters.py::test_html_option_with_file - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_presenters.py::test_htmldir_option - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_presenters.py::test_html_option_with_stdout - assert 'Traceback (most recent call last):\n  File "/var/tmp/portage/dev-util/diffoscope-243/work/diffoscope-243/diffoscope/diff.py", line 334, in diff\n    with FIFOFeeder(feeder1, fifo1_path) as fifo1,...
FAILED tests/test_progress.py::test_status_fd - assert 2 == 1
FAILED tests/test_readers.py::test_json - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/comparators/test_containers.py::test_different - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/comparators/test_deb.py::test_identification_of_md5sums_in_deb - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/comparators/test_deb.py::test_identification_of_data_tar - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/comparators/test_deb.py::test_skip_comparison_of_known_identical_files - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/comparators/test_deb.py::test_compare_non_existing - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/comparators/test_deb.py::test_compare_different_compression - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/comparators/test_deb.py::test_uncompressed_data_tar - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/comparators/test_deb.py::test_uncompressed_control_tar - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/comparators/test_deb.py::test_compare_different_compression_multiple_files - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/comparators/test_debian.py::test_dot_buildinfo_compare_non_existing - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/comparators/test_ipk.py::test_compare_non_existing - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/comparators/test_tar.py::test_no_differences - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/comparators/test_tar.py::test_compare_non_existing - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/comparators/test_tar.py::test_no_permissions_dir_in_tarball - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/comparators/test_utils.py::test_fuzzy_matching - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/comparators/test_utils.py::test_fuzzy_matching_only_once - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/comparators/test_utils.py::test_no_fuzzy_matching - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
FAILED tests/comparators/test_utils.py::test_no_fuzzy_matching_new_file - AttributeError: 'str' object has no attribute 'decode'. Did you mean: 'encode'?
============================================================= 40 failed, 532 passed, 111 skipped, 17 deselected, 227 warnings, 15 errors in 55.49s =============================================================
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information