[diffoscope] diffoscope unable to use dumppdf.py

vicvbcun guix at ikherbers.com
Thu Oct 15 09:25:10 UTC 2026


Hello,

The function `find_executable()` in diffoscope/tools.py allows commands 
to have a ".py" suffix, explicitly calling out dumppdf as an example, 
but the `Dumppdf` class in diffoscope/comparators/pdf.py hard codes 
"dumppdf" as command name.

As a result, if dumppdf.py is available, one gets a traceback when 
comparing PDF files:

--8<---------------cut here---------------start------------->8---
Traceback (most recent call last):                                  |    0%                             ETA:  --:--:--
  File "/gnu/store/...-diffoscope-332/bin/.diffoscope-real", line 11, in <module>
    sys.exit(obj())
             ^^^^^
  File "/gnu/store/...-diffoscope-332/lib/python3.12/site-packages/diffoscope/main.py", line 780, in main
    sys.exit(run_diffoscope(parsed_args))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/gnu/store/...-diffoscope-332/lib/python3.12/site-packages/diffoscope/main.py", line 720, in run_diffoscope
    difference = compare_root_paths(path1, path2)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/gnu/store/...-diffoscope-332/lib/python3.12/site-packages/diffoscope/comparators/utils/compare.py", line 75, in compare_root_paths
    difference = compare_files(file1, file2)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/gnu/store/...-diffoscope-332/lib/python3.12/site-packages/diffoscope/comparators/utils/compare.py", line 154, in compare_files
    return file1.compare(file2, source)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/gnu/store/...-diffoscope-332/lib/python3.12/site-packages/diffoscope/comparators/utils/file.py", line 536, in compare
    difference = self._compare_using_details(other, source)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/gnu/store/...-diffoscope-332/lib/python3.12/site-packages/diffoscope/comparators/utils/file.py", line 437, in _compare_using_details
    details.extend(self.compare_details(other, source))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/gnu/store/...-diffoscope-332/lib/python3.12/site-packages/diffoscope/comparators/pdf.py", line 105, in compare_details
    Difference.from_operation(Dumppdf, self.path, other.path)
  File "/gnu/store/...-diffoscope-332/lib/python3.12/site-packages/diffoscope/difference.py", line 267, in from_operation
    return Difference.from_operation_exc(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/gnu/store/...-diffoscope-332/lib/python3.12/site-packages/diffoscope/difference.py", line 288, in from_operation_exc
    feeder1, operation1, excluded1 = operation_and_feeder(path1)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/gnu/store/...-diffoscope-332/lib/python3.12/site-packages/diffoscope/difference.py", line 285, in operation_and_feeder
    operation.start()
  File "/gnu/store/...-diffoscope-332/lib/python3.12/site-packages/diffoscope/comparators/utils/command.py", line 48, in start
    self._process = subprocess.run(
                    ^^^^^^^^^^^^^^^
  File "/gnu/store/...-python-3.12.12/lib/python3.12/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/gnu/store/...-python-3.12.12/lib/python3.12/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/gnu/store/...-python-3.12.12/lib/python3.12/subprocess.py", line 1955, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'dumppdf'
--8<---------------cut here---------------end--------------->8---

It is of course possible to patch the Guix `python-pdfminer-six` package 
to strip the ".py" suffix but the current handling seems suboptimal.

vicvbcun

P.S: I'm not subscribed to the list, so please CC me in replies.


More information about the diffoscope mailing list