From a321764b924aea0f2b323b6007896c35050e4d29 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 9 Aug 2024 16:39:56 -0300 Subject: [PATCH] fix: Check if read-only files exist in __init__ --- aider/coders/base_coder.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 701c0ecad..50bbe0039 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -320,7 +320,13 @@ class Coder: self.find_common_root() if read_only_fnames: - self.abs_read_only_fnames = set(self.abs_root_path(fname) for fname in read_only_fnames) + self.abs_read_only_fnames = set() + for fname in read_only_fnames: + abs_fname = self.abs_root_path(fname) + if os.path.exists(abs_fname): + self.abs_read_only_fnames.add(abs_fname) + else: + self.io.tool_error(f"Error: Read-only file {fname} does not exist. Skipping.") if map_tokens is None: use_repo_map = main_model.use_repo_map