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

lintly fails if the PR contains a non utf-8 character #56

Open
ikerexxe opened this issue Apr 5, 2022 · 0 comments
Open

lintly fails if the PR contains a non utf-8 character #56

ikerexxe opened this issue Apr 5, 2022 · 0 comments

Comments

@ikerexxe
Copy link

ikerexxe commented Apr 5, 2022

I'm working on a PR that includes a configuration file with Japanese characters. Even though that file isn't checked by the code reviewer the execution fails while getting the PR diff.

Logs:

Lintly: 2022-04-05 13:14:22,481 [INFO] lintly.builds: Lintly found violations in 43 files
Lintly: 2022-04-05 13:14:22,482 [DEBUG] lintly.backends.github: Sending a get request to /repos/SSSD/sssd/pulls/6065
Traceback (most recent call last):
  File "/usr/local/bin/lintly", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/lintly/cli.py", line 74, in main
    build.execute()
  File "/usr/local/lib/python3.9/site-packages/lintly/builds.py", line 76, in execute
    diff = self.get_pr_diff()
  File "/usr/local/lib/python3.9/site-packages/lintly/builds.py", line 86, in get_pr_diff
    return self.git_client.get_pr_diff(self.config.pr)
  File "/usr/local/lib/python3.9/site-packages/lintly/backends/github.py", line 173, in get_pr_diff
    return diff.decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x90 in position 17043: invalid start byte
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

No branches or pull requests

1 participant