Skip to content

Fix encoding of process output under windows - #766

Merged
sds merged 3 commits into
sds:masterfrom
rymut:master
Nov 3, 2021
Merged

sds merged 3 commits into
sds:masterfrom
rymut:master

Conversation

@rymut

@rymut rymut commented Oct 29, 2021

Copy link
Copy Markdown
Contributor

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

sds commented Nov 2, 2021

Copy link
Copy Markdown
Owner

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

rymut commented Nov 3, 2021

Copy link
Copy Markdown
Contributor Author

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.

@sds sds left a comment

Copy link
Copy Markdown
Owner

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