summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorssid <ssid@chromium.org>2015-04-15 05:29:36 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-15 12:29:46 +0000
commit723a007e43d66c624b6cff92f11b7e1ccab4b904 (patch)
treec6951a41193f0a3c0247526dce26797c62a8e894 /tools
parentccb01814f9dc000b0fec81cffc5e965b5a9c8cd7 (diff)
downloadchromium_src-723a007e43d66c624b6cff92f11b7e1ccab4b904.zip
chromium_src-723a007e43d66c624b6cff92f11b7e1ccab4b904.tar.gz
chromium_src-723a007e43d66c624b6cff92f11b7e1ccab4b904.tar.bz2
Fixing crash on chrome profiler on generating html trace.
The chrome profiler opens file without utf-8 encoding, so the html trace file was not getting generated. This CL changes the file opening to have utf-8 encoding. BUG=477295 Review URL: https://codereview.chromium.org/1068693003 Cr-Commit-Position: refs/heads/master@{#325230}
Diffstat (limited to 'tools')
-rw-r--r--tools/profile_chrome/trace_packager.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/profile_chrome/trace_packager.py b/tools/profile_chrome/trace_packager.py
index d880f7b..4ec3f9a 100644
--- a/tools/profile_chrome/trace_packager.py
+++ b/tools/profile_chrome/trace_packager.py
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import codecs
import gzip
import json
import os
@@ -21,7 +22,7 @@ from trace_viewer.build import trace2html
def _PackageTracesAsHtml(trace_files, html_file):
- with open(html_file, 'w') as f:
+ with codecs.open(html_file, mode='w', encoding='utf-8') as f:
trace2html.WriteHTMLForTracesToFile(trace_files, f)
for trace_file in trace_files:
os.unlink(trace_file)