diff options
author | Michaël Zasso <targos@protonmail.com> | 2019-10-18 11:56:21 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2019-10-20 16:06:39 +0200 |
commit | a4e075f66833d08fc426c9406eb3894ec56326c1 (patch) | |
tree | e7cc21378df81dcb45714030d5eacbbdb9e40568 /tools | |
parent | 425357a11c40f3f6d39dba85feb8533ad038aa6e (diff) | |
download | android-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-x | tools/test.py | 5 |
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) |