Skip to content

Commit dcd33ca

Browse files
committed
test: setup PYTHONIOENCODING on Windows
This is required to ensure that we encode the strings correctly when redirected. This allows the printing to succeed where it would fail previously due to encoding failures.
1 parent 2fad025 commit dcd33ca

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/lit.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ def append_to_env_path(directory):
183183
config.environment['PATH'] = \
184184
os.path.pathsep.join((directory, config.environment['PATH']))
185185

186+
if kIsWindows:
187+
config.environment['PYTHONIOENCODING'] = 'UTF8'
188+
186189
# Tweak the PATH to include the tools dir and the scripts dir.
187190
if swift_obj_root is not None:
188191
llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)

0 commit comments

Comments
 (0)