[Reproducible-commits] [debbindiff] 01/02: Fallback to binary comparison when text encoding gets misdetected
Jérémy Bobbio
lunar at moszumanska.debian.org
Wed Jan 7 11:04:33 UTC 2015
This is an automated email from the git hooks/post-receive script.
lunar pushed a commit to branch master
in repository debbindiff.
commit c75ebdd8f8d07af570fc535e37a531c4d52240c5
Author: Jérémy Bobbio <lunar at debian.org>
Date: Fri Jan 2 15:40:42 2015 +0100
Fallback to binary comparison when text encoding gets misdetected
---
debbindiff/comparators/text.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/debbindiff/comparators/text.py b/debbindiff/comparators/text.py
index 8b6064f..fae8d1e 100644
--- a/debbindiff/comparators/text.py
+++ b/debbindiff/comparators/text.py
@@ -26,8 +26,8 @@ def compare_text_files(path1, path2, encoding, source=None):
try:
lines1 = codecs.open(path1, 'r', encoding=encoding).readlines()
lines2 = codecs.open(path2, 'r', encoding=encoding).readlines()
- except LookupError, e:
- # unknown encoding
+ except (LookupError, UnicodeDecodeError) as e:
+ # unknown or misdetected encoding
return compare_binary_files(path1, path2, source)
if lines1 == lines2:
return []
--
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