[Git][reproducible-builds/diffoscope][master] Become tolerant to malformed .changes files.

Chris Lamb gitlab at salsa.debian.org
Tue Mar 16 10:39:11 UTC 2021



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
acd8c556 by Roland Clobus at 2021-03-16T10:54:30+01:00
Become tolerant to malformed .changes files.

Test case: diffoscope /usr/share/doc/libsane-common/canon/canon.changes /usr/share/doc/libsane-common/canon/canon.changes

- - - - -


1 changed file:

- diffoscope/comparators/debian.py


Changes:

=====================================
diffoscope/comparators/debian.py
=====================================
@@ -24,6 +24,7 @@ import logging
 from debian.deb822 import Dsc, Deb822
 
 from diffoscope.changes import Changes
+from diffoscope.changes import ChangesFileException
 from diffoscope.difference import Difference
 
 from .utils.file import File
@@ -223,7 +224,10 @@ class DotChangesFile(DebControlFile):
         if not super().recognizes(file):
             return False
 
-        file._deb822 = Changes(filename=file.path)
+        try:
+            file._deb822 = Changes(filename=file.path)
+        except ChangesFileException:
+            return False
 
         try:
             file._deb822.validate("sha256", check_signature=False)



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/acd8c5565ebe60d474d4b532ddd9d40409d3c32b

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/acd8c5565ebe60d474d4b532ddd9d40409d3c32b
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20210316/94d88a59/attachment.htm>


More information about the rb-commits mailing list