Skip to content

Crash using --new-file

Diffoscope crashes with the --new-file option when dir2 contain a file in a subfolder that doesn't exist in dir1.

Log:

Traceback (most recent call last):
  File "/.../python3.10/site-packages/diffoscope/main.py", line 766, in main
    sys.exit(run_diffoscope(parsed_args))
  File "/.../python3.10/site-packages/diffoscope/main.py", line 717, in run_diffoscope
    difference = compare_root_paths(path1, path2)
  File "/.../python3.10/site-packages/diffoscope/comparators/utils/compare.py", line 63, in compare_root_paths
    return compare_directories(path1, path2)
  File "/.../python3.10/site-packages/diffoscope/comparators/directory.py", line 207, in compare_directories
    return FilesystemDirectory(path1).compare(FilesystemDirectory(path2))
  File "/.../python3.10/site-packages/diffoscope/comparators/directory.py", line 278, in compare
    differences.extend(my_container.compare(other_container))
  File "/.../python3.10/site-packages/diffoscope/comparators/utils/container.py", line 197, in compare_pair
    difference = compare_files(
  File "/.../python3.10/site-packages/diffoscope/comparators/utils/compare.py", line 144, in compare_files
    difference = difference.get_reverse()
AttributeError: 'list' object has no attribute 'get_reverse'

Command used:

diffoscope --html aa.html example/dir1 example/dir2 --new-file

example.zip

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information