Update the subprocess calls to use the specified encoding.

This commit is contained in:
Paul Gauthier (aider) 2024-07-30 15:18:51 -03:00
parent 9c406cd176
commit 9b129a7f03

View file

@ -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: