Use errors='replace' with subprocess (#3096)

This commit is contained in:
Masen Furer 2024-04-17 12:59:52 -07:00 committed by GitHub
parent 9b7e5f4710
commit 5466d0d9a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -145,6 +145,7 @@ def new_process(args, run: bool = False, show_logs: bool = False, **kwargs):
"stdout": None if show_logs else subprocess.PIPE,
"universal_newlines": True,
"encoding": "UTF-8",
"errors": "replace", # Avoid UnicodeDecodeError in unknown command output
**kwargs,
}
console.debug(f"Running command: {args}")