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: