From 6af686f3bdad6e3575adc90afdbee5697529cbc9 Mon Sep 17 00:00:00 2001 From: Dendy Faist Date: Sat, 24 Feb 2024 12:37:31 +0100 Subject: [PATCH] fix: Couldn't save documents --- src/files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/files.py b/src/files.py index b2b2c2b..3f16da0 100644 --- a/src/files.py +++ b/src/files.py @@ -81,7 +81,7 @@ class DocumentTree(): def document_read(self, path: str) -> str | None: internal_path = os.path.join(self.base, *path.split('/')) + '.md' if os.path.exists(internal_path): - return open(internal_path).read() + return open(internal_path, 'r').read() # File doesn't exist return None @@ -90,7 +90,7 @@ class DocumentTree(): internal_path = os.path.join(self.base, *path.split('/')) + '.md' # TODO: Check if the directory exists before writing - with open(internal_path) as file: + with open(internal_path, 'w') as file: file.write(text) # -------------------------------