-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
UnicodeDecodeError bug #309
Comments
@xiaohuazi123 as a temporary fix, you can change |
@xiaohuazi123 does this print import sys
print(sys.getdefaultencoding()) If so, we could use that instead of harcoding to utf-8. https://docs.python.org/3/library/sys.html#sys.getdefaultencoding |
I have got the same problem at another place. My Github Actions workflow fails because of this issue. The strange thing is that at one repo it works and at another it fails. The nox config differs a bit, but the part where it fails is the same command. The job runs on all three os (ubuntu, macos, windows) and only windows fails. Working repo CI example I also checked some sorts of locale settings in the very job-VMs that is failing and both - the working and broken one - have the same settings - on all there OS:
The error causing EDIT1: EDIT2: |
According to my findings above and in consideration of the above table I would presume that there are 2 solutions to this problem:
I think the first one would be the better option? My reasoning is that you ask for the encoding of stdout where your goal is to print to. EDIT1: Also the docs on EDIT2: I tested the above table on a local windows machine and got EDIT3: On the in EDIT2 mentioned windows machine I run the git bash shell as integrated terminal in VSCode. Sometimes the monkeypatched version fails and and the next run it works. Makes no sense to me at current. I will try some stuff. |
@stsewd I opened a PR if you want to take a look. |
…380) * add decode_output func to decode popen output fixes #309 by trying to decode popen output with utf8 first and on error tries other encodings provided by the systems preferences. * simplified decode_output function * fix linting issues * fix double hard coded utf8 * change utf8 to utf-8 * add tests for decode_output * fix linting issues * simplify nested try...except block and fix nested exception msg Co-authored-by: Claudio Jolowicz <cjolowicz@gmail.com> * fix tests for simplified deode_output Co-authored-by: Claudio Jolowicz <cjolowicz@gmail.com>
Describe the bug
I was using the pre-commit tool when I encountered an error associated with nox
The related references:pre-commit/pre-commit#1400
How to reproduce
The problem environment
Windows 7
Python version: Python 3.7.6
Here's the detail log
Expected behavior
This problem is bound to come up, and every time I commit code, this seems to be a nox bug
The text was updated successfully, but these errors were encountered: