From 682bdd3e53298bc79497049f3395228fe4a27923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 4 Jul 2023 19:17:26 +0200 Subject: [PATCH] Fix #11813 (daca: script crashes (UnicodeDecodeError) when checking package lgeneral) (#5217) --- tools/donate_cpu_lib.py | 6 +++--- tools/test-my-pr.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/donate_cpu_lib.py b/tools/donate_cpu_lib.py index daddaddf3..278118160 100644 --- a/tools/donate_cpu_lib.py +++ b/tools/donate_cpu_lib.py @@ -15,7 +15,7 @@ import shlex # Version scheme (MAJOR.MINOR.PATCH) should orientate on "Semantic Versioning" https://semver.org/ # Every change in this script should result in increasing the version number accordingly (exceptions may be cosmetic # changes) -CLIENT_VERSION = "1.3.45" +CLIENT_VERSION = "1.3.46" # Timeout for analysis with Cppcheck in seconds CPPCHECK_TIMEOUT = 30 * 60 @@ -399,9 +399,9 @@ def __run_command(cmd, print_cmd=True): time_start = time.time() comm = None if sys.platform == 'win32': - p = subprocess.Popen(shlex.split(cmd, comments=False, posix=False), stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) + p = subprocess.Popen(shlex.split(cmd, comments=False, posix=False), stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, errors='surrogateescape') else: - p = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, preexec_fn=os.setsid) + p = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, errors='surrogateescape', preexec_fn=os.setsid) try: comm = p.communicate(timeout=CPPCHECK_TIMEOUT) return_code = p.returncode diff --git a/tools/test-my-pr.py b/tools/test-my-pr.py index 1f8a76bcf..715df3297 100755 --- a/tools/test-my-pr.py +++ b/tools/test-my-pr.py @@ -138,6 +138,7 @@ if __name__ == "__main__": print("No package downloaded") continue else: + print('Package: ' + package) tgz = package source_path, source_found = lib.unpack_package(work_path, tgz, c_only=args.c_only, cpp_only=args.cpp_only)