From 9b129a7f03c1b95a829b329ed3f071cff7141ab0 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 30 Jul 2024 15:18:51 -0300 Subject: [PATCH] Update the subprocess calls to use the specified encoding. --- aider/linter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aider/linter.py b/aider/linter.py index 0e5570a43..2b663d737 100644 --- a/aider/linter.py +++ b/aider/linter.py @@ -44,10 +44,11 @@ class Linter: cmd = cmd.split() process = subprocess.Popen( - cmd, cwd=self.root, stdout=subprocess.PIPE, stderr=subprocess.STDOUT + cmd, cwd=self.root, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, + encoding=self.encoding ) stdout, _ = process.communicate() - errors = stdout.decode() + errors = stdout if process.returncode == 0: return # zero exit status @@ -140,6 +141,7 @@ class Linter: capture_output=True, text=True, check=False, + encoding=self.encoding ) errors = result.stdout + result.stderr except Exception as e: