From 27c1fd0262001309885aa2770c59e44443f9ff30 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 31 Mar 2025 09:14:49 +1300 Subject: [PATCH] fix: Handle FileNotFoundError in find_common_root --- aider/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aider/utils.py b/aider/utils.py index 322a44316..c6773f140 100644 --- a/aider/utils.py +++ b/aider/utils.py @@ -308,7 +308,11 @@ def find_common_root(abs_fnames): except OSError: pass - return safe_abs_path(os.getcwd()) + try: + return safe_abs_path(os.getcwd()) + except FileNotFoundError: + # Fallback if cwd is deleted + return "." def format_tokens(count):