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

Decode messages from dotnet tool as UTF-8 #1204

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yukawa
Copy link
Collaborator

@yukawa yukawa commented Mar 6, 2025

Description

If dotnet tool outputs non-ASCII characters and the system locale is not utf-8, then update_deps.py can fail due to UnicodeDecodeError. This commit addresses the above issue by explicitly setting utf-8 when calling subprocess.Popen.

Closes #1203

Issue IDs

Steps to test new behaviors (if any)

  • OS: Windows 11 24H2
  • Steps:
    1. Make sure dotnet tool --help shows messages in Japanese.
    2. Make sure python -c "import locale; print(locale.getpreferredencoding())" shows cp932
    3. Confirm python build_tools/update_deps.py finishes without any error.

If 'dotnet tool' outputs non-ASCII characters and the system locale is
not 'utf-8', then 'update_deps.py' can fail due to UnicodeDecodeError.
This commit addresses the above issue by explicitly setting 'utf-8' when
calling subprocess.Popen.

Closes google#1203
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant