[diffoscope] 01/01: Avoid decoding strings by opening source files in binary mode.

Chris Lamb chris at chris-lamb.co.uk
Fri Mar 9 05:48:11 CET 2018


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

lamby pushed a commit to branch master
in repository diffoscope.

commit ea5dc2ca8621d4b170fa7fba6abe51991654cc84
Author: Chris Lamb <lamby at debian.org>
Date:   Thu Mar 8 20:47:43 2018 -0800

    Avoid decoding strings by opening source files in binary mode.
---
 tests/test_source.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test_source.py b/tests/test_source.py
index 9b32c85..c5b3cf5 100644
--- a/tests/test_source.py
+++ b/tests/test_source.py
@@ -26,5 +26,5 @@ BASE_DIR = os.path.dirname(os.path.abspath(diffoscope.__file__))
 
 def test_dos_mbr():
     for x in glob.iglob(os.path.join(BASE_DIR, '**', '*.py'), recursive=True):
-        with open(x, encoding='utf-8', errors='replace') as f:
-            assert 'DOS/MBR' not in f.read()
+        with open(x, 'rb') as f:
+            assert b'DOS/MBR' not in f.read()

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


More information about the diffoscope mailing list