Package: diffoscope
Version: 45
Severity: normal

Dear Maintainer,

When comparing directories that contain broken symlinks, e.g. by the following

mkdir a
mkdir b
cd a
ln -s 1 link
cd ..
cd b
ln -s 2 link
diffoscope a b

...diffoscope crashes with a Python exception when attempting to open the file
pointed by the symlink:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/diffoscope/", line 177, in 
  File "/usr/lib/python3/dist-packages/diffoscope/", line 148, in 
    parsed_args.file1, parsed_args.file2)
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/", 
line 90, in compare_root_paths
    return compare_directories(path1, path2)
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/", 
line 100, in compare_directories
    return FilesystemDirectory(path1).compare(FilesystemDirectory(path2))
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/", 
line 147, in compare
    my_file, other_file, source=name)
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/", 
line 98, in compare_files
    if file1.has_same_content_as(file2):
  File "/usr/lib/python3/dist-packages/diffoscope/", line 137, in 
    return original_function(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/diffoscope/comparators/", line 
178, in has_same_content_as
    my_size = os.path.getsize(self.path)
  File "/usr/lib/python3.5/", line 50, in getsize
    return os.stat(filename).st_size
FileNotFoundError: [Errno 2] No such file or directory: 'a/link'

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/6 CPU cores)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect
(Debian in a chroot)

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

Versions of packages diffoscope recommends:
ii  acl                        2.2.52-2
ii  binutils-multiarch
ii  bzip2                      1.0.6-8
ii  caca-utils                 0.99.beta19-2+b1
ii  cpio                       2.11+dfsg-4.1
ii  default-jdk [java-sdk]     2:1.7-52.1
ii  enjarify                   20151118-1
ii  fontforge-extras           0.3-4
ii  fp-utils                   2.6.4+dfsg-8
ii  fp-utils-2.6.4 [fp-utils]  2.6.4+dfsg-8
ii  genisoimage                9:1.1.11-3
ii  gettext                    0.19.7-2
ii  ghc                        7.10.3-5
ii  gnupg                      1.4.20-1
ii  mono-utils       
ii  openjdk-7-jdk [java-sdk]   7u91-2.6.3-3
ii  pdftk                      2.02-3
ii  poppler-utils              0.38.0-2
ii  python3-debian             0.1.27
ii  python3-guestfs            1:1.32.0-2
ii  python3-rpm      
ii  python3-tlsh               3.4.1+20151014-1
ii  rpm2cpio         
ii  sng                        1.0.6-3
ii  sqlite3                    3.10.0-1
ii  squashfs-tools             1:4.3-3
ii  unzip                      6.0-20
ii  vim-common                 2:7.4.963-1+b1
ii  xz-utils                   5.1.1alpha+20120614-2.1

Versions of packages diffoscope suggests:
pn  libjs-jquery  <none>

-- debconf information excluded

Reproducible-builds mailing list

Reply via email to