Bug#855233: diffoscope: Crashes when comparing bad JSON on Python pre-3.5

Brett Smith debbug at brettcsmith.org
Wed Feb 15 19:47:01 UTC 2017


Package: diffoscope
Severity: normal
Tags: upstream patch

Dear Maintainer,

Commit 50be22f checks for JSON decoding errors by catching
json.JSONDecodeError.  This class was introduced in Python 3.5.  Earlier
version of the json module simply raised ValueError in the same situation.

When running tests on earlier versions of Python, test_json.test_invalid
crashes when it fails to find json.JSONDecodeError.

ValueError is the base class of json.JSONDecodeError, so catching that works
as expected on Python 3.5 and older versions.  The attached patch makes that
change and sees the test pass on older versions of Python.

Thanks,

-- System Information:
Debian Release: 8.7
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-0.bpo.1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=UTF-8) (ignored: LC_ALL set to en_US.utf8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-comparators.json-Catch-bad-JSON-errors-on-Python-pre.patch
Type: text/x-diff
Size: 1153 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20170215/0720eb82/attachment.patch>


More information about the Reproducible-builds mailing list