mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-24 01:14:22 +01:00
Fix execute_python_file workspace mount & Windows path formatting (#4996)
* fix for #4975 * Add TODO based on code comment. * Use builtin `Path.as_posix()` * Remove TODO --------- Co-authored-by: Reinier van der Leer <github@pwuts.nl>
This commit is contained in:
@@ -145,11 +145,14 @@ def execute_python_file(filename: str, agent: Agent) -> str:
|
||||
logger.debug(f"Running {file_path} in a {image_name} container...")
|
||||
container: DockerContainer = client.containers.run(
|
||||
image_name,
|
||||
["python", str(file_path.relative_to(agent.workspace.root))],
|
||||
[
|
||||
"python",
|
||||
file_path.relative_to(agent.workspace.root).as_posix(),
|
||||
],
|
||||
volumes={
|
||||
agent.config.workspace_path: {
|
||||
"bind": "/workspace",
|
||||
"mode": "ro",
|
||||
"mode": "rw",
|
||||
}
|
||||
},
|
||||
working_dir="/workspace",
|
||||
|
||||
Reference in New Issue
Block a user