[Reproducible-commits] [debbindiff] 01/03: Retry once with utf8 for misdetected encodings

Reiner Herrmann reiner at reiner-h.de
Sun Jul 12 11:00:41 UTC 2015


This is an automated email from the git hooks/post-receive script.

deki-guest pushed a commit to branch master
in repository debbindiff.

commit 726ea22f5439d248323d981402b88f83e8245905
Author: Reiner Herrmann <reiner at reiner-h.de>
Date:   Sun Jul 12 12:15:06 2015 +0200

    Retry once with utf8 for misdetected encodings
---
 debbindiff/comparators/text.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/debbindiff/comparators/text.py b/debbindiff/comparators/text.py
index caf9480..591da20 100644
--- a/debbindiff/comparators/text.py
+++ b/debbindiff/comparators/text.py
@@ -31,4 +31,7 @@ def compare_text_files(path1, path2, encoding=None, source=None):
         return Difference.from_file(file1, file2, path1, path2, source)
     except (LookupError, UnicodeDecodeError):
         # unknown or misdetected encoding
-        return compare_binary_files(path1, path2, source)
+        if encoding is not 'utf-8':
+            return compare_text_files(path1, path2, 'utf-8', source)
+        else:
+            return compare_binary_files(path1, path2, source)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/debbindiff.git



More information about the Reproducible-commits mailing list