From 2c0249b1e833108cc13c0589f3018851f2311d0b Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 28 Mar 2016 22:48:00 +0200 Subject: Even more python3 portability --- libmat/archive.py | 4 ++-- libmat/exiftool.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'libmat') diff --git a/libmat/archive.py b/libmat/archive.py index 12ca55e..cfc818d 100644 --- a/libmat/archive.py +++ b/libmat/archive.py @@ -194,9 +194,9 @@ class ZipStripper(GenericArchiveStripper): zinfo = zipfile.ZipInfo(item.filename, date_time=ZIP_EPOCH) zinfo.compress_type = zipfile.ZIP_DEFLATED zinfo.create_system = 3 # Linux - zinfo.comment = '' + zinfo.comment = b'' with open(path, 'r') as f: - zipout.writestr(zinfo, f.read()) + zipout.writestr(zinfo, str(f.read())) # os.utime(path, (ZIP_EPOCH_SECONDS, ZIP_EPOCH_SECONDS)) # zipout.write(path, item.filename) zipin.close() diff --git a/libmat/exiftool.py b/libmat/exiftool.py index efe6002..83513b4 100644 --- a/libmat/exiftool.py +++ b/libmat/exiftool.py @@ -47,8 +47,8 @@ class ExiftoolStripper(parser.GenericParser): field name : value field name : value """ - output = subprocess.Popen(['exiftool', self.filename], - stdout=subprocess.PIPE).communicate()[0] + output = str(subprocess.Popen(['exiftool', self.filename], + stdout=subprocess.PIPE).communicate()[0]) meta = {} for i in output.split('\n')[:-1]: # chop last char ('\n') key = i.split(':')[0].strip() -- cgit v1.3