Skip to content

[LSP] Print LSP output as ASCII #106

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

Merged
merged 1 commit into from
Feb 18, 2023

Conversation

bnbarham
Copy link
Contributor

sys.stdout seems to be ascii on some configurations, eg. Jenkins. When the string has UTF8 characters, this results in:

UnicodeEncodeError: 'ascii' codec can't encode character...

The output here is really just for debugging test failures, so just encode the string as ASCII and output that instead.

Resolves rdar://105608805.

`sys.stdout` seems to be `ascii` on some configurations, eg. Jenkins.
When the string has UTF8 characters, this results in:
```
UnicodeEncodeError: 'ascii' codec can't encode character...
```

The output here is really just for debugging test failures, so just
encode the string as ASCII and output that instead.

Resolves rdar://105608805.
@bnbarham
Copy link
Contributor Author

I can't reproduce this locally, so I assume the default encoding for Jenkin's console is 'ascii' rather than 'utf-8'. This is only failing on rebranch, presumably clangd is now outputting a unicode character where it wasn't before.

@bnbarham
Copy link
Contributor Author

We hit unrelated failures, I'm just going to merge.

@bnbarham bnbarham merged commit 3e6ee26 into swiftlang:main Feb 18, 2023
@bnbarham bnbarham deleted the lsp-encoding-error branch February 18, 2023 03:32
@bnbarham
Copy link
Contributor Author

bnbarham commented Feb 18, 2023

We hit unrelated failures, I'm just going to merge.

Well. That was a mistake. Should have just re-run - I missed a closing paren when I was moving this change over from the VM I was testing in. Fixed in #107

(FWIW Windows passed so I assumed it would be fine since it wasn't a platform specific change, but turns out we don't run these for Windows)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant