diff options
author | nduca@chromium.org <nduca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-29 02:53:13 +0000 |
---|---|---|
committer | nduca@chromium.org <nduca@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-29 02:53:13 +0000 |
commit | e056295931896692580ddb756562cf70abba0982 (patch) | |
tree | ae277356c33d368d491841d51286f5615454bf5c /tools/telemetry | |
parent | 695182d91592d504460f29ba167d6bc7ddc2afd0 (diff) | |
download | chromium_src-e056295931896692580ddb756562cf70abba0982.zip chromium_src-e056295931896692580ddb756562cf70abba0982.tar.gz chromium_src-e056295931896692580ddb756562cf70abba0982.tar.bz2 |
[telemetry] Open trace files with unicode encoding
On clank, some of the strings in the trace have unicode in them. Writing those
to a regular open'd file raises an encode exception.
NOTRY=True
Review URL: https://chromiumcodereview.appspot.com/12079015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179278 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/telemetry')
-rw-r--r-- | tools/telemetry/telemetry/page_runner.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/telemetry/telemetry/page_runner.py b/tools/telemetry/telemetry/page_runner.py index 0afe9c9..0cecf2a 100644 --- a/tools/telemetry/telemetry/page_runner.py +++ b/tools/telemetry/telemetry/page_runner.py @@ -1,6 +1,7 @@ # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import codecs import logging import os import time @@ -263,7 +264,8 @@ class PageRunner(object): trace_file_index = trace_file_index + 1 else: trace_file = '%s.json' % trace_file_base - with open(trace_file, 'w') as trace_file: + with codecs.open(trace_file, 'w', + encoding='utf-8') as trace_file: trace_file.write(trace) logging.info('Trace saved.') |