Skip to content

Commit

Permalink
Merge pull request #120 from bnbarham/set-python-encoding
Browse files Browse the repository at this point in the history
Set PYTHONIOENCODING for all lit tests
  • Loading branch information
bnbarham committed Sep 7, 2023
2 parents 9ea8272 + 038b201 commit 7d6bf13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lit.cfg
Expand Up @@ -96,6 +96,9 @@ if platform.system() == "Darwin":
if 'XDG_CACHE_HOME' in os.environ:
config.environment['XDG_CACHE_HOME'] = os.environ['XDG_CACHE_HOME']

if sys.version_info[0] >= 3:
config.environment['PYTHONIOENCODING'] = 'UTF8'

###

# Use features like this in lit:
Expand Down
2 changes: 1 addition & 1 deletion test-sourcekit-lsp/test-sourcekit-lsp.py
Expand Up @@ -138,7 +138,7 @@ def main():
skargs = [args.sourcekit_lsp, '--sync', '-Xclangd', '-sync']
p = subprocess.Popen(skargs, stdin=subprocess.PIPE, stdout=subprocess.PIPE, encoding='utf-8')
out, _ = p.communicate(lsp.script)
print(out.encode(encoding='ascii', errors='replace'))
print(out)
print('')

if p.returncode == 0:
Expand Down

0 comments on commit 7d6bf13

Please sign in to comment.