From 0ea006e3f22a814d711a55276d6d83ace29ddb38 Mon Sep 17 00:00:00 2001 From: flywire Date: Sat, 11 Jul 2015 23:59:38 +1000 Subject: [PATCH] Change open to 'wb' to support Windows --- debug/unpackrmp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debug/unpackrmp.py b/debug/unpackrmp.py index e6f54e3..42517c3 100755 --- a/debug/unpackrmp.py +++ b/debug/unpackrmp.py @@ -7,7 +7,7 @@ BS = 64*1024 def unpack_rmp(rmpfile, upath): - rmp = open(rmpfile) + rmp = open(rmpfile, 'rb') (numfiles, numfiles) = struct.unpack('II', rmp.read(8)) files = [] for i in range(0, numfiles): @@ -29,7 +29,7 @@ def unpack_rmp(rmpfile, upath): continue sys.stderr.write('Unpacking %s\n' % (i[0])) rmp.seek(i[1], 0) - w = open(os.path.join(upath, i[0]), 'w') + w = open(os.path.join(upath, i[0]), 'wb') for k in range(0, (i[2]+BS-1)/BS): data = rmp.read(min(i[2]-BS*k, BS)) w.write(data)