Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: allow test tap output to include Unicode characters #47175

Merged
merged 1 commit into from Mar 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion tools/test.py
Expand Up @@ -44,6 +44,7 @@
import multiprocessing
import errno
import copy
import io


if sys.version_info >= (3, 5):
Expand Down Expand Up @@ -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:
Expand Down