From 90bec92d1f3dd343f00abbfb02c5e4a17ce6593a Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 21 Feb 2020 09:34:49 -0500 Subject: [PATCH] Fix python3 for os import Need to be explicit about binary data with python 3. --- librarian/imageimporter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/librarian/imageimporter.py b/librarian/imageimporter.py index ede11d6a..07578b62 100644 --- a/librarian/imageimporter.py +++ b/librarian/imageimporter.py @@ -98,10 +98,10 @@ def scan_iso(filename): return filelist, filecontents def fingerprint(filename): - with open(sys.argv[1]) as archive: + with open(sys.argv[1], 'rb') as archive: header = archive.read(32768) archive.seek(32769) - if archive.read(6) == 'CD001\x01': + if archive.read(6) == b'CD001\x01': # ISO image isoinfo = scan_iso(filename) name = None