Bug#904685: diffoscope: RuntimeError when trying to extract an encrypted file (.bmp)

Ricardo Gaviria ricardo at unitelabs.ch
Thu Jul 26 17:10:15 BST 2018

Package: diffoscope
Version: 51
Severity: normal

Dear Maintainer,

I was trying to diff two versions of a windows installer directory, and
encountered a RuntimeError due to diffoscope not being able to extract
an encrypted file.

I would have expected for the system to maybe report that such files
could not be extracted, and proceed with the rest of the diffing but
rather was faced with the stack trace and incomplete diff:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/diffoscope/__main__.py", line 177,
in main
  File "/usr/lib/python3/dist-packages/diffoscope/__main__.py", line 148,
in run_diffoscope
    parsed_args.file1, parsed_args.file2)
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/__init__.py",
line 92, in compare_root_paths
    return compare_directories(path1, path2)
"/usr/lib/python3/dist-packages/diffoscope/comparators/directory.py", line
104, in compare_directories
    return FilesystemDirectory(path1).compare(FilesystemDirectory(path2))
"/usr/lib/python3/dist-packages/diffoscope/comparators/directory.py", line
157, in compare
    my_file, other_file, source=name)
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/__init__.py",
line 113, in compare_files
    return file1.compare(file2, source)
"/usr/lib/python3/dist-packages/diffoscope/comparators/directory.py", line
157, in compare
    my_file, other_file, source=name)
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/__init__.py",
line 113, in compare_files
    return file1.compare(file2, source)
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/binary.py",
line 199, in compare
    difference = self._compare_using_details(other, source)
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/binary.py",
line 174, in _compare_using_details
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/__init__.py",
line 116, in compare_commented_files
    difference = compare_files(file1, file2, source=source)
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/__init__.py",
line 102, in compare_files
    if file1.has_same_content_as(file2):
  File "/usr/lib/python3/dist-packages/diffoscope/__init__.py", line 143,
in tool_check
    return original_function(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/binary.py",
line 185, in has_same_content_as
    my_size = os.path.getsize(self.path)
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/utils.py",
line 242, in path
    self._path = self.container.extract(self._name, self._temp_dir.name)
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/zip.py", line
90, in extract
    with self.archive.open(member_name) as source, open(targetpath, 'wb')
as target:
  File "/usr/lib/python3.5/zipfile.py", line 1299, in open
    "required for extraction" % name)
RuntimeError: File acrobat.bmp is encrypted, password required for

Is this expected behaviour or is there a cmd line parameter which I
could use to prevent this?


-- System Information:
Debian Release: stretch/sid
  APT prefers xenial-security
  APT policy: (500, 'xenial-security'), (500, 'xenial'), (100,
Architecture: amd64 (x86_64)
Foreign Architectures: i386, arm64

Kernel: Linux 4.13.0-45-generic (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages diffoscope depends on:
ii  python3-libarchive-c   2.1-3
ii  python3-magic          1:5.25-2ubuntu1.1
ii  python3-pkg-resources  20.7.0-1
pn  python3:any            <none>

Versions of packages diffoscope recommends:
ii  acl                                2.2.52-3
ii  binutils-multiarch                 2.26.1-1ubuntu1~16.04.6
ii  bzip2                              1.0.6-8
ii  caca-utils                         0.99.beta19-2build2~gcc5.2
ii  colord                             1.2.12-1ubuntu1
ii  cpio                               2.11+dfsg-5ubuntu1
ii  default-jdk [java-sdk]             2:1.8-56ubuntu2
ii  enjarify                           20151118-1
ii  fontforge-extras                   0.3-4ubuntu1
ii  fp-utils                           3.0.0+dfsg-2
ii  fp-utils-3.0.0 [fp-utils]          3.0.0+dfsg-2
ii  genisoimage                        9:1.1.11-3ubuntu1
ii  gettext                            0.19.7-2ubuntu3
ii  ghc                                7.10.3-7
ii  ghostscript                        9.18~dfsg~0-0ubuntu2.8
ii  gnupg                              1.4.20-1ubuntu3.2
ii  mono-utils               
ii  openjdk-8-jdk [java-sdk]           8u171-b11-0ubuntu0.16.04.1
ii  oracle-java8-installer [java-sdk]  8u171-1~webupd8~0
ii  pdftk                              2.02-4
ii  poppler-utils                      0.41.0-0ubuntu1.7
ii  python3-debian                     0.1.27ubuntu2
ii  python3-guestfs                    1:1.32.2-4ubuntu2
ii  python3-rpm              
ii  python3-tlsh                       3.4.4+20151206-1build1
ii  rpm2cpio                 
ii  sng                                1.1.0-1
ii  sqlite3                            3.11.0-1ubuntu1
ii  squashfs-tools                     1:4.3-3ubuntu2.16.04.1
ii  unzip                              6.0-20ubuntu1
ii  vim-common                         2:7.4.1689-3ubuntu1.2
ii  xz-utils                           5.1.1alpha+20120614-2ubuntu2

Versions of packages diffoscope suggests:
ii  libjs-jquery  1.11.3+dfsg-4

-- no debconf information

Ricardo Gaviria
Software Engineer, UniteLabs
*M: *+41 77 956 2376
*W: *http://unitelabs.ch
*In: *https://www.linkedin.com/in/ricardogaviria/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/reproducible-builds/attachments/20180726/aace3fbb/attachment.html>

More information about the Reproducible-builds mailing list