Skip to content

Commit c522b2e

Browse files
authored
fix: subprocess encoding on windows (#1386)
1 parent 6c1f50e commit c522b2e

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath"
3-
version = "2.10.0"
3+
version = "2.10.1"
44
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

src/uipath/_cli/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,15 @@
1111

1212
# Windows console uses codepages (e.g. cp1252) that can't encode Unicode
1313
# characters used by Rich spinners (Braille) and emoji output.
14+
# When piped (not a TTY), keep the system encoding so the parent process
15+
# can decode our output, but use errors="replace" to avoid write-side crashes.
1416
if sys.platform == "win32":
1517
for _stream in (sys.stdout, sys.stderr):
1618
if hasattr(_stream, "reconfigure"):
17-
_stream.reconfigure(encoding="utf-8")
18-
19+
if _stream.isatty():
20+
_stream.reconfigure(encoding="utf-8")
21+
else:
22+
_stream.reconfigure(errors="replace")
1923
# DO NOT ADD HEAVY IMPORTS HERE
2024
#
2125
# Every import at the top of this file runs on EVERY command.

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)