From 593d989e8e8e1253fe034adffbcdaef926ebf73f Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sun, 3 Nov 2019 17:09:54 +0100 Subject: [PATCH] deps: V8: cherry-pick a7dffcd767be MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: [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 Commit-Queue: Michaƫl Zasso Cr-Commit-Position: refs/heads/master@{#64717} Refs: https://github.com/v8/v8/commit/a7dffcd767be6e6122dd3911c8388b5ff76ac590 Backport-PR-URL: https://github.com/nodejs/node/pull/30109 PR-URL: https://github.com/nodejs/node/pull/30218 Reviewed-By: Richard Lau Reviewed-By: David Carlier Reviewed-By: Colin Ihrig Reviewed-By: Chengzhong Wu Reviewed-By: Joyee Cheung --- deps/v8/tools/gen-postmortem-metadata.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deps/v8/tools/gen-postmortem-metadata.py b/deps/v8/tools/gen-postmortem-metadata.py index 0715b07dc14af7..e49d5acd29ae85 100644 --- a/deps/v8/tools/gen-postmortem-metadata.py +++ b/deps/v8/tools/gen-postmortem-metadata.py @@ -49,6 +49,7 @@ # for py2/py3 compatibility from __future__ import print_function +import io import re import sys @@ -380,7 +381,7 @@ def load_objects(): def load_objects_from_file(objfilename, checktypes): - objfile = open(objfilename, 'r'); + objfile = io.open(objfilename, 'r', encoding='utf-8'); in_insttype = False; typestr = ''; @@ -575,7 +576,7 @@ def load_fields(): def load_fields_from_file(filename): - inlfile = open(filename, 'r'); + inlfile = io.open(filename, 'r', encoding='utf-8'); # # Each class's fields and the corresponding offsets are described in the