From 48b85316bb9a3a498e360fe6c9fc7cd051f69635 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Sun, 23 Feb 2014 13:51:22 +0100 Subject: [PATCH] Always read binary files with mode rb --- bin/pyglslunit.py | 2 +- build.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/pyglslunit.py b/bin/pyglslunit.py index 0a7f55627c..b0154a8196 100644 --- a/bin/pyglslunit.py +++ b/bin/pyglslunit.py @@ -114,7 +114,7 @@ def main(argv): output = open(options.output, 'w') else: output = sys.stdout - output.write(pystache.render(open(options.template).read(), context)) + output.write(pystache.render(open(options.template, 'rb').read(), context)) if __name__ == '__main__': diff --git a/build.py b/build.py index 635d33da89..b62a926812 100755 --- a/build.py +++ b/build.py @@ -153,7 +153,7 @@ PROJ4JS_ZIP_MD5 = '17caad64cf6ebc6e6fe62f292b134897' def report_sizes(t): stringio = StringIO() gzipfile = gzip.GzipFile(t.name, 'w', 9, stringio) - with open(t.name) as f: + with open(t.name, 'rb') as f: shutil.copyfileobj(f, gzipfile) gzipfile.close() rawsize = os.stat(t.name).st_size