From 7a141d8e46bbbe4266f37797f34d963e7a72530b Mon Sep 17 00:00:00 2001 From: Boris Yumankulov Date: Tue, 7 Oct 2025 15:43:16 +0500 Subject: [PATCH] fix(winetricks): resolve QProcess channel mode warning in install handler Signed-off-by: Boris Yumankulov --- portprotonqt/dialogs.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/portprotonqt/dialogs.py b/portprotonqt/dialogs.py index 23339ff..3fe98ea 100644 --- a/portprotonqt/dialogs.py +++ b/portprotonqt/dialogs.py @@ -1345,8 +1345,16 @@ class WinetricksDialog(QDialog): """Обработчик завершения установки.""" error_message = "" if self.apply_process is not None: - error_data = self.apply_process.readAllStandardError().data() - error_message = bytes(error_data).decode('utf-8', 'ignore') + # Читаем вывод в зависимости от режима каналов + if self.apply_process.processChannelMode() == QProcess.ProcessChannelMode.MergedChannels: + # Если каналы объединены, читаем из StandardOutput + output_data = self.apply_process.readAllStandardOutput().data() + error_message = bytes(output_data).decode('utf-8', 'ignore') + else: + # Если каналы разделены, читаем из StandardError + error_data = self.apply_process.readAllStandardError().data() + error_message = bytes(error_data).decode('utf-8', 'ignore') + if exit_code != 0 or exit_status != QProcess.ExitStatus.NormalExit: logger.error(f"Winetricks install failed: {error_message}") QMessageBox.warning(self, _("Error"), _("Installation failed. Check logs.")) @@ -1356,7 +1364,6 @@ class WinetricksDialog(QDialog): existing = {line.strip() for line in f if line.strip()} else: existing = set() - with open(self.log_path, 'a') as f: for name in selected: if name not in existing: