From 83d37676ae1eb7ea4e7e629481b9760b179a6818 Mon Sep 17 00:00:00 2001 From: oop7 <110548351+oop7@users.noreply.github.com> Date: Sat, 29 Nov 2025 14:44:39 +0200 Subject: [PATCH] Suppress output when killing process tree on Windows Replaces capture_output with stdout and stderr redirected to DEVNULL in subprocess.run for taskkill, preventing codec issues and suppressing command output. --- src/core/ytsage_downloader.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/ytsage_downloader.py b/src/core/ytsage_downloader.py index 2faabed..12f1ed2 100644 --- a/src/core/ytsage_downloader.py +++ b/src/core/ytsage_downloader.py @@ -144,9 +144,11 @@ class DownloadThread(QThread): if sys.platform == "win32": # Windows: Use taskkill to kill the entire process tree # /T = kill child processes, /F = force kill + # Use subprocess.run with no encoding to avoid codec issues subprocess.run( ["taskkill", "/F", "/T", "/PID", str(pid)], - capture_output=True, + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, creationflags=SUBPROCESS_CREATIONFLAGS, ) logger.debug(f"Killed process tree on Windows (PID: {pid})")