From 1e4371ce1157c8f293a8574fd75ea39120fc189f Mon Sep 17 00:00:00 2001 From: Cristian Pufu Date: Fri, 27 Feb 2026 07:58:53 +0200 Subject: [PATCH] fix: subprocess encoding on windows --- pyproject.toml | 2 +- src/uipath/_cli/__init__.py | 8 ++++++-- uv.lock | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2b70825a2..4fd106947 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath" -version = "2.10.0" +version = "2.10.1" description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools." readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.11" diff --git a/src/uipath/_cli/__init__.py b/src/uipath/_cli/__init__.py index 1c5ae464a..f271fcf29 100644 --- a/src/uipath/_cli/__init__.py +++ b/src/uipath/_cli/__init__.py @@ -11,11 +11,15 @@ # Windows console uses codepages (e.g. cp1252) that can't encode Unicode # characters used by Rich spinners (Braille) and emoji output. +# When piped (not a TTY), keep the system encoding so the parent process +# can decode our output, but use errors="replace" to avoid write-side crashes. if sys.platform == "win32": for _stream in (sys.stdout, sys.stderr): if hasattr(_stream, "reconfigure"): - _stream.reconfigure(encoding="utf-8") - + if _stream.isatty(): + _stream.reconfigure(encoding="utf-8") + else: + _stream.reconfigure(errors="replace") # DO NOT ADD HEAVY IMPORTS HERE # # Every import at the top of this file runs on EVERY command. diff --git a/uv.lock b/uv.lock index e01051639..d5b170efa 100644 --- a/uv.lock +++ b/uv.lock @@ -2531,7 +2531,7 @@ wheels = [ [[package]] name = "uipath" -version = "2.10.0" +version = "2.10.1" source = { editable = "." } dependencies = [ { name = "applicationinsights" },