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) # -------------------------------