Commit ea5dc2ca authored by Chris Lamb's avatar Chris Lamb 💬

Avoid decoding strings by opening source files in binary mode.

parent 014908f0
......@@ -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()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment