Skip to content

Commit a7dffcd

Browse files
targosCommit Bot
authored andcommitted
[postmortem] Load files using utf-8 to support Python 3
Change-Id: I174d38cc33210c07d1a7596627e1b2d21bb06313 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1895560 Reviewed-by: Mathias Bynens <[email protected]> Commit-Queue: Michaël Zasso <[email protected]> Cr-Commit-Position: refs/heads/master@{#64717}
1 parent 17e01bc commit a7dffcd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tools/gen-postmortem-metadata.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
# for py2/py3 compatibility
5050
from __future__ import print_function
5151

52+
import io
5253
import re
5354
import sys
5455

@@ -376,7 +377,7 @@ def load_objects():
376377

377378

378379
def load_objects_from_file(objfilename, checktypes):
379-
objfile = open(objfilename, 'r');
380+
objfile = io.open(objfilename, 'r', encoding='utf-8');
380381
in_insttype = False;
381382
in_torque_insttype = False
382383

@@ -585,7 +586,7 @@ def load_fields():
585586

586587

587588
def load_fields_from_file(filename):
588-
inlfile = open(filename, 'r');
589+
inlfile = io.open(filename, 'r', encoding='utf-8');
589590

590591
#
591592
# Each class's fields and the corresponding offsets are described in the

0 commit comments

Comments
 (0)