From dd857aeccf8f280622bce442ebce3753e9e0bc5c Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 13 Feb 2025 12:12:33 -0800 Subject: [PATCH] fix: Handle file reading with encoding, ignore decoding errors --- aider/io.py | 1 + 1 file changed, 1 insertion(+) diff --git a/aider/io.py b/aider/io.py index 5ab11f0d6..ce82c5bd2 100644 --- a/aider/io.py +++ b/aider/io.py @@ -368,6 +368,7 @@ class InputOutput: return self.read_image(filename) try: + # ignore decoding errors. ai! with open(str(filename), "r", encoding=self.encoding) as f: return f.read() except FileNotFoundError: