Skip to content
Closed
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
2 changes: 2 additions & 0 deletions agent/copilot_acp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,8 @@ def _run_prompt(self, prompt_text: str, *, timeout_seconds: float) -> tuple[str,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
encoding="utf-8",
errors="replace",
bufsize=1,
cwd=self._acp_cwd,
env=_build_subprocess_env(),
Expand Down
2 changes: 2 additions & 0 deletions scripts/run_tests_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ def _run_one_file(
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
text=True,
encoding="utf-8",
errors="replace",
env=os.environ,
# POSIX: place the child at the head of its own process group so
# _kill_tree can SIGKILL the group atomically.
Expand Down
2 changes: 2 additions & 0 deletions tools/environments/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ def _popen_bash(
stderr=subprocess.STDOUT,
stdin=subprocess.PIPE if stdin_data is not None else subprocess.DEVNULL,
text=True,
encoding="utf-8",
errors="replace",
**kwargs,
)
if stdin_data is not None:
Expand Down
2 changes: 2 additions & 0 deletions tools/transcription_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,8 @@ def _run_command_stt(command: str, timeout: float) -> subprocess.CompletedProces
"stdout": subprocess.PIPE,
"stderr": subprocess.PIPE,
"text": True,
"encoding": "utf-8",
"errors": "replace",
}
if os.name == "nt":
popen_kwargs["creationflags"] = getattr(subprocess, "CREATE_NEW_PROCESS_GROUP", 0)
Expand Down
2 changes: 2 additions & 0 deletions tools/tts_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,8 @@ def _run_command_tts(command: str, timeout: float) -> subprocess.CompletedProces
"stdout": subprocess.PIPE,
"stderr": subprocess.PIPE,
"text": True,
"encoding": "utf-8",
"errors": "replace",
}
Comment thread
Icather marked this conversation as resolved.
if os.name == "nt":
popen_kwargs["creationflags"] = getattr(subprocess, "CREATE_NEW_PROCESS_GROUP", 0)
Expand Down
10 changes: 8 additions & 2 deletions tui_gateway/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,8 @@ def __init__(self, session_key: str, model: str, profile_home: str | None = None
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
encoding="utf-8",
errors="replace",
bufsize=1,
cwd=os.getcwd(),
env=env,
Expand Down Expand Up @@ -9767,7 +9769,7 @@ def _(rid, params: dict) -> dict:

try:
res = subprocess.run(
argv, capture_output=True, text=True, timeout=120, stdin=subprocess.DEVNULL,
argv, capture_output=True, text=True, encoding="utf-8", errors="replace", timeout=120, stdin=subprocess.DEVNULL,
creationflags=windows_hide_flags(),
)
except subprocess.TimeoutExpired:
Expand Down Expand Up @@ -11864,6 +11866,8 @@ def _(rid, params: dict) -> dict:
[sys.executable, "-m", "hermes_cli.main", *argv],
capture_output=True,
text=True,
encoding="utf-8",
errors="replace",
timeout=min(int(params.get("timeout", 240)), 600),
cwd=os.getcwd(),
# cli.exec runs `python -m hermes_cli.main` (can drive the agent) β†’
Expand Down Expand Up @@ -11934,6 +11938,8 @@ def _(rid, params: dict) -> dict:
shell=True,
capture_output=True,
text=True,
encoding="utf-8",
errors="replace",
timeout=30,
stdin=subprocess.DEVNULL,
env=sanitized_env,
Expand Down Expand Up @@ -14481,7 +14487,7 @@ def _(rid, params: dict) -> dict:
return _err(rid, 5001, "shell.exec unavailable: approval safety module not importable")
try:
r = subprocess.run(
cmd, shell=True, capture_output=True, text=True, timeout=30, cwd=os.getcwd(),
cmd, shell=True, capture_output=True, text=True, encoding="utf-8", errors="replace", timeout=30, cwd=os.getcwd(),
stdin=subprocess.DEVNULL,
)
return _ok(
Expand Down
Loading