From b441c0346139915c0b38234824870e70c7717a5f Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 29 Aug 2024 09:45:17 -0700 Subject: [PATCH] fix: armor os.path.basename call in exception handler --- aider/report.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aider/report.py b/aider/report.py index b95cb1ff5..58aa9b7b6 100644 --- a/aider/report.py +++ b/aider/report.py @@ -65,7 +65,10 @@ def exception_handler(exc_type, exc_value, exc_traceback): parts = line.split('"') if len(parts) > 1: full_path = parts[1] - basename = os.path.basename(full_path) + try: + basename = os.path.basename(full_path) + except Exception: + basename = full_path line = line.replace(full_path, basename) tb_lines_with_basenames.append(line)