We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4530582 commit 78ce8d3Copy full SHA for 78ce8d3
tools/test.py
@@ -44,6 +44,7 @@
44
import multiprocessing
45
import errno
46
import copy
47
+import io
48
49
50
if sys.version_info >= (3, 5):
@@ -1595,7 +1596,13 @@ def Main():
1595
1596
parser.print_help()
1597
return 1
1598
- ch = logging.StreamHandler(sys.stdout)
1599
+ stream = sys.stdout
1600
+ try:
1601
+ sys.stdout.reconfigure(encoding='utf8')
1602
+ except AttributeError:
1603
+ # Python < 3.7 does not have reconfigure
1604
+ stream = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8')
1605
+ ch = logging.StreamHandler(stream)
1606
logger.addHandler(ch)
1607
logger.setLevel(logging.INFO)
1608
if options.logfile:
0 commit comments