Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #621 from NghiaNguyen/master
Browse files Browse the repository at this point in the history
Making sure temporary named file is created with 'w' mode.
  • Loading branch information
dj2 committed Sep 30, 2014
2 parents 76a4496 + 64b415e commit f306225
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion trace_viewer/build/trace2html.py
Expand Up @@ -53,7 +53,7 @@ def __init__(self, filename):
def WriteToFile(self, output_file):
output_file.write('<script id="viewer-data" type="application/json">\n')

with tempfile.NamedTemporaryFile() as compressed_file:
with tempfile.NamedTemporaryFile('w') as compressed_file:
gzfile = gzip.open(compressed_file.name, 'wb')
with open(self._filename, 'r') as f:
shutil.copyfileobj(f, gzfile)
Expand Down

0 comments on commit f306225

Please sign in to comment.