mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
tools: allow test tap output to include unicode characters
PR-URL: https://github.com/nodejs/node/pull/47175 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Christian Clauss <cclauss@me.com>
This commit is contained in:
1 parent
460bcc042e
commit
e0a00ebfc5
1 file changed
+8
-1
+8
-1
@@ -44,6 +44,7 @@ import utils
|
||||
import multiprocessing
|
||||
import errno
|
||||
import copy
|
||||
import io
|
||||
|
||||
|
||||
if sys.version_info >= (3, 5):
|
||||
@@ -1595,7 +1596,13 @@ def Main():
|
||||
parser.print_help()
|
||||
return 1
|
||||
|
||||
ch = logging.StreamHandler(sys.stdout)
|
||||
stream = sys.stdout
|
||||
try:
|
||||
sys.stdout.reconfigure(encoding='utf8')
|
||||
except AttributeError:
|
||||
# Python < 3.7 does not have reconfigure
|
||||
stream = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8')
|
||||
ch = logging.StreamHandler(stream)
|
||||
logger.addHandler(ch)
|
||||
logger.setLevel(logging.INFO)
|
||||
if options.logfile:
|
||||
|
||||
Reference in new issue
Block a user