Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e0a00eb

Browse filesBrowse files
MoLowdanielleadams
authored andcommitted
tools: allow test tap output to include unicode characters
PR-URL: #47175 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Christian Clauss <cclauss@me.com>
1 parent 460bcc0 commit e0a00eb
Copy full SHA for e0a00eb

File tree

Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed
Open diff view settings
Collapse file

‎tools/test.py‎

Copy file name to clipboardExpand all lines: tools/test.py
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import multiprocessing
4545
import errno
4646
import copy
47+
import io
4748

4849

4950
if sys.version_info >= (3, 5):
@@ -1595,7 +1596,13 @@ def Main():
15951596
parser.print_help()
15961597
return 1
15971598

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)
15991606
logger.addHandler(ch)
16001607
logger.setLevel(logging.INFO)
16011608
if options.logfile:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.