From 3c48c4a2d61cf597d6e4d40ebb814f2a2356d607 Mon Sep 17 00:00:00 2001 From: Reinier van der Leer Date: Fri, 25 Aug 2023 02:15:38 +0200 Subject: [PATCH] Disable bytecode generation for python execution commands --- autogpt/commands/execute_code.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autogpt/commands/execute_code.py b/autogpt/commands/execute_code.py index 98500cf7..77a678b6 100644 --- a/autogpt/commands/execute_code.py +++ b/autogpt/commands/execute_code.py @@ -122,7 +122,7 @@ def execute_python_file(filename: Path, agent: Agent) -> str: f"Auto-GPT is running in a Docker container; executing {file_path} directly..." ) result = subprocess.run( - ["python", str(file_path)], + ["python", "-B", str(file_path)], capture_output=True, encoding="utf8", cwd=agent.config.workspace_path, @@ -162,6 +162,7 @@ def execute_python_file(filename: Path, agent: Agent) -> str: image_name, [ "python", + "-B", file_path.relative_to(agent.workspace.root).as_posix(), ], volumes={