From 27e362c6ea512d971baa81717328307c3e2ca793 Mon Sep 17 00:00:00 2001 From: Reinier van der Leer Date: Tue, 17 Oct 2023 14:36:33 -0700 Subject: [PATCH] AutoGPT: Fix file ops (vol. 2) --- autogpts/autogpt/autogpt/commands/file_operations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autogpts/autogpt/autogpt/commands/file_operations.py b/autogpts/autogpt/autogpt/commands/file_operations.py index f82aaa85..8e3b54ab 100644 --- a/autogpts/autogpt/autogpt/commands/file_operations.py +++ b/autogpts/autogpt/autogpt/commands/file_operations.py @@ -242,11 +242,11 @@ def append_to_file( """ directory = os.path.dirname(filename) os.makedirs(directory, exist_ok=True) - with agent.workspace.open_file(filename, "a") as f: + with open(filename, "a") as f: f.write(text) if should_log: - with agent.workspace.open_file(filename, "r") as f: + with open(filename, "r") as f: checksum = text_checksum(f.read()) log_operation("append", filename, agent, checksum=checksum)