Skip to content

Commit

Permalink
Always read binary files with mode rb
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Feb 23, 2014
1 parent 3aedca7 commit 48b8531
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/pyglslunit.py
Expand Up @@ -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__':
Expand Down
2 changes: 1 addition & 1 deletion build.py
Expand Up @@ -153,7 +153,7 @@
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
Expand Down

0 comments on commit 48b8531

Please sign in to comment.