From 3297df54f240705e5e8058cbae39f3f6e41effb5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 30 Jan 2024 08:42:58 +0100 Subject: pyside_tool.py: Work around console encoding issues on Windows Use subprocess.call() instead of capturing the output. As a drive-by, use stderr for error messages. Pick-to: 6.6 6.5 Change-Id: I28c9623754b0718cd4a5041475f451247ac5811f Reviewed-by: Qt CI Bot Reviewed-by: Christian Tismer --- sources/pyside-tools/pyside_tool.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'sources/pyside-tools') diff --git a/sources/pyside-tools/pyside_tool.py b/sources/pyside-tools/pyside_tool.py index 84bd61986..7daacc22d 100644 --- a/sources/pyside-tools/pyside_tool.py +++ b/sources/pyside-tools/pyside_tool.py @@ -8,7 +8,6 @@ import subprocess import sys import sysconfig from pathlib import Path -from subprocess import PIPE, Popen import PySide6 as ref_mod @@ -57,13 +56,11 @@ def qt_tool_wrapper(qt_tool, args, libexec=False): exe = pyside_dir / qt_tool cmd = [os.fspath(exe)] + args - proc = Popen(cmd, stderr=PIPE) - out, err = proc.communicate() - if err: - msg = err.decode("utf-8") + returncode = subprocess.call(cmd) + if returncode != 0: command = ' '.join(cmd) - print(f"Error: {msg}\nwhile executing '{command}'") - sys.exit(proc.returncode) + print(f"'{command}' returned {returncode}", file=sys.stderr) + sys.exit(returncode) def pyside_script_wrapper(script_name): -- cgit v1.2.3