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

Fix encoding of process output under windows #766

Merged
merged 3 commits into from
Nov 3, 2021
Merged

Conversation

rymut
Copy link
Contributor

@rymut rymut commented Oct 29, 2021

Output of commands under windows is not UTF-8 by default, this
can lead to "invalid byte sequence in UTF-8" error on symlink check

Output of commands under windows is not UTF-8 by default, this
can lead to "invalid byte sequence in UTF-8" error on sylink check
@sds
Copy link
Owner

sds commented Nov 2, 2021

Thanks for the pull request, @rymut.

This currently breaks a large number of tests when running on Linux (which is what the vast majority of Overcommit users use).

      Failure/Error: ec = Encoding::Converter.new(Encoding.locale_charmap, 'UTF-8')
      Encoding::ConverterNotFoundError:                                                                                                                                                 code converter not found (UTF-8 to UTF-8)

If the issue is only reproducible when checking for bad symlinks, can we isolate this change to just change the encoding on the problematic line? Specifically:

win32_symlink?(result.stdout)

@rymut
Copy link
Contributor Author

rymut commented Nov 3, 2021

Thanks @sds: in my case only calling win32_symlink is reproducible - but the underlying problem will still be present.
My current commit should fix the issue with braking tests under linux - if the problems with the tests will be still persisting then I will isolate a change to win32_simlink.

Copy link
Owner

@sds sds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making the changes. Tests pass locally for me on macOS.

@sds sds merged commit 5fc63b9 into sds:master Nov 3, 2021
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.

2 participants