mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Fix output strip behavior discrepancy among sandboxes (#1355)
This commit is contained in:
parent
5543fe2c3e
commit
c45e2ae4d9
@ -122,7 +122,7 @@ class DockerExecBox(Sandbox):
|
||||
self.container.exec_run(
|
||||
f'kill -9 {pid}', workdir=SANDBOX_WORKSPACE_DIR)
|
||||
return -1, f'Command: "{cmd}" timed out'
|
||||
return exit_code, logs.decode('utf-8')
|
||||
return exit_code, logs.decode('utf-8').strip()
|
||||
|
||||
def copy_to(self, host_src: str, sandbox_dest: str, recursive: bool = False):
|
||||
# mkdir -p sandbox_dest if it doesn't exist
|
||||
|
||||
@ -35,7 +35,7 @@ class LocalBox(Sandbox):
|
||||
cmd, shell=True, text=True, capture_output=True,
|
||||
timeout=self.timeout, cwd=config.get('WORKSPACE_BASE')
|
||||
)
|
||||
return completed_process.returncode, completed_process.stdout
|
||||
return completed_process.returncode, completed_process.stdout.strip()
|
||||
except subprocess.TimeoutExpired:
|
||||
return -1, 'Command timed out'
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user