[Git][reproducible-builds/diffoscope][master] Fix check for whether two file types are the same.

Chris Lamb (@lamby) gitlab at salsa.debian.org
Tue Jan 25 17:34:32 UTC 2022



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
ec223f64 by Chris Lamb at 2022-01-25T09:34:21-08:00
Fix check for whether two file types are the same.

- - - - -


1 changed file:

- diffoscope/comparators/utils/compare.py


Changes:

=====================================
diffoscope/comparators/utils/compare.py
=====================================
@@ -77,7 +77,11 @@ def compare_root_paths(path1, path2):
                 difference = Difference(file1.name, file2.name)
             difference.add_details(meta)
 
-    if difference is None and type(file1) is not type(file2):
+    # We cannot use isinstance() etc. because these instances are
+    # abc-instantiated abstract base classes. We cannot even compare
+    # DESCRIPTION attributes either, as the specialize() call above may not
+    # have returned a specific instance.
+    if difference is None and str(type(file1)) != str(type(file2)):
         difference = Difference(file1.name, file2.name)
         difference.add_comment(
             "Types of files differ; human-readable metadata may match literal file contents."



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

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/ec223f64a745c85ba361a412ec2e402833981f5b
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/20220125/fc691f71/attachment.htm>


More information about the rb-commits mailing list