From e8091cecf602b10f5b25bca993ecc73ae642ad61 Mon Sep 17 00:00:00 2001 From: "Stephan T. Lavavej" Date: Sat, 3 Feb 2024 04:10:45 -0800 Subject: [PATCH] Use Python backslashreplace to avoid UNRESOLVED tests --- tests/utils/stl/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/utils/stl/util.py b/tests/utils/stl/util.py index 5bf306738d2..5949a2b8196 100644 --- a/tests/utils/stl/util.py +++ b/tests/utils/stl/util.py @@ -77,8 +77,9 @@ def decodeOutput(bytes): try: return bytes.decode() except UnicodeError: + # Use 'backslashreplace' to avoid throwing another exception for unrecognized characters. import locale - return bytes.decode(locale.getpreferredencoding(do_setlocale=False)) + return bytes.decode(locale.getpreferredencoding(do_setlocale=False), 'backslashreplace') def executeCommand(command, cwd=None, env=None, input=None, timeout=0):