From d369bcddd7e07b327ce91715288b03c6a42ce139 Mon Sep 17 00:00:00 2001 From: Andrew Senetar Date: Thu, 7 Jul 2022 19:00:09 -0500 Subject: [PATCH] Updates from investigation of #1015 - Add protection for empty hash digests in comparison of non-zero size files - Bump version to 4.3.1-dev for identification --- core/__init__.py | 2 +- core/engine.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/__init__.py b/core/__init__.py index d8f78c73..7a15dbab 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -1,2 +1,2 @@ -__version__ = "4.3.0" +__version__ = "4.3.1-dev" __appname__ = "dupeGuru" diff --git a/core/engine.py b/core/engine.py index f9e9a519..fb0692ca 100644 --- a/core/engine.py +++ b/core/engine.py @@ -303,12 +303,13 @@ def getmatches_by_contents(files, bigsize=0, j=job.nulljob): # skip hashing for zero length files result.append(Match(first, second, 100)) continue - if first.digest_partial == second.digest_partial: + # if digests are the same (and not None) then files match + if first.digest_partial == second.digest_partial and first.digest_partial is not None: if bigsize > 0 and first.size > bigsize: - if first.digest_samples == second.digest_samples: + if first.digest_samples == second.digest_samples and first.digest_samples is not None: result.append(Match(first, second, 100)) else: - if first.digest == second.digest: + if first.digest == second.digest and first.digest_samples is not None: result.append(Match(first, second, 100)) group_count += 1 j.add_progress(desc=PROGRESS_MESSAGE % (len(result), group_count))