gh-119070: Avoid test crash due to Unicode in stderr output (GH-119747)

This commit is contained in:
Steve Dower 2024-05-29 21:51:30 +01:00 committed by GitHub
parent bc01c5d225
commit e902503980
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -232,7 +232,7 @@ class RunPyMixin:
p.stdin.close()
p.wait(10)
out = p.stdout.read().decode("utf-8", "replace")
err = p.stderr.read().decode("ascii", "replace")
err = p.stderr.read().decode("ascii", "replace").replace("\uFFFD", "?")
if p.returncode != expect_returncode and support.verbose and not allow_fail:
print("++ COMMAND ++")
print([self.py_exe, *args])