From 7c8e7936021adfdd195d8ab788b0cfb75556bf43 Mon Sep 17 00:00:00 2001 From: flywire Date: Sun, 12 Jul 2015 00:02:40 +1000 Subject: [PATCH] Change open to 'wb' to support Windows --- debug/unpacka00.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debug/unpacka00.py b/debug/unpacka00.py index d61b2ad..5df38ff 100755 --- a/debug/unpacka00.py +++ b/debug/unpacka00.py @@ -8,7 +8,7 @@ def unpack_a00(a00file, upath): a00size = os.stat(a00file).st_size - a00 = open(a00file) + a00 = open(a00file, 'rb') numfiles = struct.unpack('I', a00.read(4))[0] files = [] if not os.path.exists(upath): @@ -20,7 +20,7 @@ def unpack_a00(a00file, upath): filename = ('%10u.jpg' % (filenum)).replace(' ', '0') sys.stderr.write('Unpacking %s\n' % (filename)) filesize = struct.unpack('I', a00.read(4))[0] - w = open(os.path.join(upath, filename), 'w') + w = open(os.path.join(upath, filename), 'wb') for k in range(0, (filesize+BS-1)/BS): data = a00.read(min(filesize-BS*k, BS)) w.write(data)