fix: reconfigure stdout/stderr to UTF-8 on Windows to prevent charmap encoding errors#1385
Merged
cristipufu merged 1 commit intomainfrom Feb 27, 2026
Merged
fix: reconfigure stdout/stderr to UTF-8 on Windows to prevent charmap encoding errors#1385cristipufu merged 1 commit intomainfrom
cristipufu merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a Windows-specific encoding issue where the console's default codepage (e.g., cp1252) cannot handle Unicode characters used by Rich library components like Braille spinners and emoji output. The fix reconfigures stdout and stderr to UTF-8 encoding on Windows systems at CLI initialization time, before any heavy imports are loaded.
Changes:
- Version bump from 2.9.14 to 2.9.15
- Added Windows UTF-8 stream reconfiguration in CLI initialization
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| uv.lock | Updated package version to 2.9.15 |
| pyproject.toml | Bumped version to 2.9.15 |
| src/uipath/_cli/init.py | Added Windows-specific UTF-8 encoding configuration for stdout/stderr to prevent charmap encoding errors with Unicode characters |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
initialization
(Braille) and emoji output
Why this approach
Most popular Python CLIs (Rich, Click, pip) don't fix this themselves, they either document PYTHONUTF8=1 as a
user-side workaround, or avoid Unicode characters entirely.
Python 3.15 will make UTF-8 the default everywhere (https://peps.python.org/pep-0686/), but until then every Python
CLI on Windows is affected.
We chose
sys.stdout.reconfigure(encoding="utf-8")over alternatives because:themselves
automatic for the user
Modern terminals (Windows Terminal, PowerShell 7, VS Code) already expect UTF-8, this fix just aligns Python's output
encoding with what they want. On legacy terminals, it prevents crashes (characters may render imperfectly but won't
throw exceptions).