[Reproducible-commits] [diffoscope] 01/23: Open more files in binary mode XXX
Jérémy Bobbio
lunar at moszumanska.debian.org
Sat Sep 19 23:18:19 UTC 2015
This is an automated email from the git hooks/post-receive script.
lunar pushed a commit to branch pu/py3
in repository diffoscope.
commit 956819d659deef2f09c1c6121123ba4c95e2598d
Author: Jérémy Bobbio <lunar at debian.org>
Date: Fri Sep 18 15:34:11 2015 +0200
Open more files in binary mode XXX
---
diffoscope/comparators/binary.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/diffoscope/comparators/binary.py b/diffoscope/comparators/binary.py
index 6294620..4f4d944 100644
--- a/diffoscope/comparators/binary.py
+++ b/diffoscope/comparators/binary.py
@@ -49,7 +49,7 @@ def xxd(path):
def hexdump_fallback(path):
hexdump = ''
- with open(path) as f:
+ with open(path, 'rb') as f:
for buf in iter(lambda: f.read(32), b''):
hexdump += u'%s\n' % hexlify(buf)
return hexdump
@@ -162,7 +162,7 @@ class File(object):
my_size = os.path.getsize(self.path)
other_size = os.path.getsize(other.path)
if my_size == other_size and my_size <= SMALL_FILE_THRESHOLD:
- if open(self.path).read() == open(other.path).read():
+ if open(self.path, 'rb').read() == open(other.path, 'rb').read():
return True
return 0 == subprocess.call(['cmp', '--silent', self.path, other.path],
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the Reproducible-commits
mailing list