summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2019-10-18 11:56:21 +0200
committerMichaël Zasso <targos@protonmail.com>2019-10-20 16:06:39 +0200
commita4e075f66833d08fc426c9406eb3894ec56326c1 (patch)
treee7cc21378df81dcb45714030d5eacbbdb9e40568 /tools
parent425357a11c40f3f6d39dba85feb8533ad038aa6e (diff)
downloadandroid-node-v8-a4e075f66833d08fc426c9406eb3894ec56326c1.tar.gz
android-node-v8-a4e075f66833d08fc426c9406eb3894ec56326c1.tar.bz2
android-node-v8-a4e075f66833d08fc426c9406eb3894ec56326c1.zip
test: fix test runner for Python 3 on Windows
Explicitly open files with utf8 encoding, otherwise the system could use another encoding such as latin1 by default. PR-URL: https://github.com/nodejs/node/pull/30023 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/test.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/test.py b/tools/test.py
index 878e2bef35..04babded24 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -45,6 +45,7 @@ import multiprocessing
import errno
import copy
+from io import open
from os.path import join, dirname, abspath, basename, isdir, exists
from datetime import datetime
try:
@@ -733,8 +734,8 @@ def Execute(args, context, timeout=None, env=None, disable_core_files=False, std
)
os.close(fd_out)
os.close(fd_err)
- output = open(outname).read()
- errors = open(errname).read()
+ output = open(outname, encoding='utf8').read()
+ errors = open(errname, encoding='utf8').read()
CheckedUnlink(outname)
CheckedUnlink(errname)