mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-04-25 11:18:22 +00:00
fix: use subprocess instead of os.system in local_backend.py (#2494)
* fix: use subprocess instead of os.system in local_backend.py The sandbox backend and skill evaluation scripts use subprocess * fixing the failing test --------- Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
This commit is contained in:
parent
2bb1a2dfa2
commit
950821cb9b
@ -288,10 +288,10 @@ class LocalSandbox(Sandbox):
|
|||||||
timeout=600,
|
timeout=600,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
args = [shell, "-c", resolved_command]
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
resolved_command,
|
args,
|
||||||
executable=shell,
|
shell=False,
|
||||||
shell=True,
|
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
text=True,
|
||||||
timeout=600,
|
timeout=600,
|
||||||
|
|||||||
@ -255,7 +255,9 @@ class TestMultipleMounts:
|
|||||||
|
|
||||||
sandbox.execute_command("cat /mnt/data/test.txt")
|
sandbox.execute_command("cat /mnt/data/test.txt")
|
||||||
# Verify the command received the resolved local path
|
# Verify the command received the resolved local path
|
||||||
assert str(data_dir) in captured.get("command", "")
|
command = captured.get("command", [])
|
||||||
|
assert isinstance(command, list) and len(command) >= 3
|
||||||
|
assert str(data_dir) in command[2]
|
||||||
|
|
||||||
def test_reverse_resolve_path_does_not_match_partial_prefix(self, tmp_path):
|
def test_reverse_resolve_path_does_not_match_partial_prefix(self, tmp_path):
|
||||||
foo_dir = tmp_path / "foo"
|
foo_dir = tmp_path / "foo"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user