Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[project]
name = "uipath"
version = "2.2.26"
version = "2.2.27"
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"
dependencies = [
"uipath-runtime>=0.2.3, <0.3.0",
"uipath-runtime>=0.2.4, <0.3.0",
"uipath-core>=0.1.0, <0.2.0",
"click>=8.3.1",
"httpx>=0.28.1",
Expand Down
16 changes: 16 additions & 0 deletions src/uipath/_cli/_debug/_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import os
import signal
import sys
from concurrent.futures import ThreadPoolExecutor
from enum import Enum
from typing import Any, Literal
Expand Down Expand Up @@ -75,6 +76,7 @@ def __init__(self, verbose: bool = True):
verbose: If True, show state updates. If False, only show breakpoints.
"""
self.console = Console(force_terminal=True)
self.is_terminal = sys.stdout.isatty()
self.verbose = verbose
self.state = DebuggerState()

Expand Down Expand Up @@ -372,6 +374,20 @@ def _print_help(self) -> None:

def _print_json(self, data: dict[str, Any] | str, label: str = "data") -> None:
"""Print JSON data with enhanced hierarchy."""
# Check if output is being redirected
if not self.is_terminal:
# Plain text output for file redirection
try:
json_str = json.dumps(data, indent=2, default=str)
print(f"\n{label}:")
print(json_str)
print()
except Exception:
print(f"\n{label}:")
print(str(data))
print()
return

try:
# Create a tree for nested structure
tree = Tree(f"[bold cyan]{label}[/bold cyan]")
Expand Down
8 changes: 8 additions & 0 deletions src/uipath/_cli/_utils/_console.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import sys
from contextlib import contextmanager
from enum import Enum
from typing import Any, Iterator, Type
Expand Down Expand Up @@ -83,6 +84,13 @@ def log(
level: The log level (determines the emoji)
fg: Optional foreground color for the message
"""
# Check if stdout is closed or broken
try:
if sys.stdout.closed:
return
except (AttributeError, ValueError, OSError):
return

# Stop any active spinner before logging
self._stop_spinner_if_active()

Expand Down
10 changes: 5 additions & 5 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.