Bug#850055: diffoscope: Comparing a device with a regular file fails
Chris Lamb
lamby at debian.org
Tue Jan 3 15:58:08 UTC 2017
Package: diffoscope
Version: 66
Severity: normal
$ diffoscope --no-progress --debug /dev/null /etc/fstab
1483458952.621770 DEBUG Starting comparison
1483458952.622251 DEBUG Using Device for /dev/null
1483458952.628209 DEBUG Using TextFile for /etc/fstab
1483458952.628395 DEBUG Comparing files <<class 'abc.Device'> /dev/null> and <<class 'abc.TextFile'> /etc/fstab>
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/diffoscope/main.py", line 297, in main
sys.exit(run_diffoscope(parsed_args))
File "/usr/lib/python3/dist-packages/diffoscope/main.py", line 251, in run_diffoscope
parsed_args.path1, parsed_args.path2)
File "/usr/lib/python3/dist-packages/diffoscope/comparators/__init__.py", line 133, in compare_root_paths
return compare_files(file1, file2)
File "/usr/lib/python3/dist-packages/diffoscope/comparators/__init__.py", line 138, in compare_files
if file1.has_same_content_as(file2):
File "/usr/lib/python3/dist-packages/diffoscope/comparators/device.py", line 39, in has_same_content_as
return self.get_device() == other.get_device()
AttributeError: 'TextFile' object has no attribute 'get_device'
The other way around works:
$ diffoscope --no-progress --debug /etc/fstab /dev/null
1483459010.885976 DEBUG Starting comparison
1483459010.892007 DEBUG Using TextFile for /etc/fstab
1483459010.892327 DEBUG Using Device for /dev/null
1483459010.892452 DEBUG Comparing files <<class 'abc.TextFile'> /etc/fstab> and <<class 'abc.Device'> /dev/null>
1483459010.892538 DEBUG Binary.has_same_content: <<class 'abc.TextFile'> /etc/fstab> <<class 'abc.Device'> /dev/null>
1483459010.900649 DEBUG running ['xxd', '/etc/fstab']
1483459010.902732 DEBUG running ['xxd', '/tmp/tmp9i74wicn_diffoscope']
1483459010.904995 DEBUG done with xxd. exit code 0
1483459010.905473 DEBUG done with xxd. exit code 0
1483459010.905671 DEBUG running ['diff', '-aU7', '/tmp/tmp9pz5hgjt/f1', '/tmp/tmp9pz5hgjt/f2']
1483459010.907623 DEBUG done with diff, returncode 1, parsed True
[..]
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` lamby at debian.org / chris-lamb.co.uk
`-
More information about the Reproducible-builds
mailing list