Skip to content

Commit 038b201

Browse files
committed
Set PYTHONIOENCODING for all lit tests
Rather than the one-off hack in `test-sourcekit-lsp.py`, just set the IO encoding to UTF8 for all tests.
1 parent 6cc1a23 commit 038b201

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lit.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ if platform.system() == "Darwin":
9696
if 'XDG_CACHE_HOME' in os.environ:
9797
config.environment['XDG_CACHE_HOME'] = os.environ['XDG_CACHE_HOME']
9898

99+
if sys.version_info[0] >= 3:
100+
config.environment['PYTHONIOENCODING'] = 'UTF8'
101+
99102
###
100103

101104
# Use features like this in lit:

test-sourcekit-lsp/test-sourcekit-lsp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def main():
138138
skargs = [args.sourcekit_lsp, '--sync', '-Xclangd', '-sync']
139139
p = subprocess.Popen(skargs, stdin=subprocess.PIPE, stdout=subprocess.PIPE, encoding='utf-8')
140140
out, _ = p.communicate(lsp.script)
141-
print(out.encode(encoding='ascii', errors='replace'))
141+
print(out)
142142
print('')
143143

144144
if p.returncode == 0:

0 commit comments

Comments
 (0)