From 8f7250e99270f3120a69231ef0f0d135727f0b2b Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 29 Aug 2024 13:11:33 -0700 Subject: [PATCH] fix: protect os.path.basename call with try/except --- aider/report.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aider/report.py b/aider/report.py index b84d7715d12..7098fac786d 100644 --- a/aider/report.py +++ b/aider/report.py @@ -85,7 +85,10 @@ def exception_handler(exc_type, exc_value, exc_traceback): # Get the filename and line number from the innermost frame filename = innermost_tb.tb_frame.f_code.co_filename line_number = innermost_tb.tb_lineno - basename = os.path.basename(filename) + try: + basename = os.path.basename(filename) + except Exception: + basename = filename # Get the exception type name exception_type = exc_type.__name__