Skip to content
Merged
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
9 changes: 7 additions & 2 deletions src/copaw/agents/tools/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,14 @@ def _execute_subprocess_sync(
return code will be -1 and stderr will contain timeout information.
"""
try:
# Disable cmd.exe AutoRun (/D) to prevent spurious stderr
# from registry-configured startup scripts (e.g. "The system
# cannot find the path specified."). /S prevents quote stripping
# so the inner command is passed through unchanged.
wrapped = ["cmd", "/D", "/S", "/C", cmd]
with subprocess.Popen(
cmd,
shell=True,
wrapped,
shell=False,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=False,
Expand Down
Loading