-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
lib: print Python executable path using UTF-8 #2987
lib: print Python executable path using UTF-8 #2987
Conversation
Please add a test or tests that fails with the old code and pass with the new code so we will be alerted if there are future regressions. |
The Python executable path may have non-ASCII characters, which can make the print function fail if the environment encoding is different. This fixes this issue by using stdout.buffer, which can be used with UTF-8 encoding for the output, regardless of the environment encoding. Fixes: nodejs#2829
996f826
to
8025dcd
Compare
@cclauss thanks for reviewing. I've added a test. |
Linting is failing in CI which is unfortunately preventing the tests from being run. I did check this out and run it locally on macOS and they were failing. It could be because the test assumes that the result of |
The linter errors are caused by a new version of |
@lukekarrys thank you for your feedback. I've updated the test to fix the failure on MacOS. |
@huseyinacacak-janea I think linting should now be fixed in main. Can you try updating your branch now? |
I rebased the branch to get the |
Checklist
npm install && npm run lint && npm test
passesDescription of change
The Python executable path may have non-ASCII characters, which can make the print function fail if the environment encoding is different. This PR fixes this issue by using
stdout.buffer
, which can be used with UTF-8 encoding for the output, regardless of the environment encoding.Fixes: #2829