Fix: Konsolenfenster bei Subprozessen unter Windows unterdrückt (v1.6.3)
subprocess.CREATE_NO_WINDOW-Flag in transform.py und worker_pool_base.py gesetzt, damit beim Start aus einer PyInstaller-EXE keine Konsolenfenster für Saxon, FOP und diff-pdf erscheinen. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@
|
||||
<!-- Paket-Definition (ersetzt Product in v4) -->
|
||||
<Package
|
||||
Name="DocuMentor"
|
||||
Version="1.6.2"
|
||||
Version="1.6.3"
|
||||
Manufacturer="Vitali Graf / Software- und Datenbankentwicklung"
|
||||
UpgradeCode="F498B66C-726D-44AA-95F4-CB4FBDCEF26E"
|
||||
Language="1031"
|
||||
|
||||
@@ -253,5 +253,5 @@ HINWEISE
|
||||
|
||||
================================================================================
|
||||
Stand: April 2026
|
||||
Erstellt für: DocuMentor v1.6.2
|
||||
Erstellt für: DocuMentor v1.6.3
|
||||
================================================================================
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
; Build-Befehl: iscc installer.iss
|
||||
|
||||
#define MyAppName "DocuMentor"
|
||||
#define MyAppVersion "1.6.2"
|
||||
#define MyAppVersion "1.6.3"
|
||||
#define MyAppPublisher "Ihr Name/Organisation"
|
||||
#define MyAppURL "https://github.com/yourusername/xsl-validator"
|
||||
#define MyAppExeName "DocuMentor.exe"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "DocuMentor"
|
||||
version = "1.6.2"
|
||||
version = "1.6.3"
|
||||
description = "Professionelle XSL-Transformations-Verwaltung und PDF-Generierung"
|
||||
readme = "README.md"
|
||||
license = {text = "MIT"}
|
||||
|
||||
@@ -9,10 +9,14 @@ Dieses Modul implementiert die Transformations-Pipeline:
|
||||
|
||||
import logging
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
from typing import Any, Optional, TYPE_CHECKING
|
||||
|
||||
# Verhindert Konsolenfenster bei Subprozessen in PyInstaller-EXE (Windows)
|
||||
_SUBPROCESS_FLAGS = subprocess.CREATE_NO_WINDOW if sys.platform == "win32" else 0
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from saxon_pool import SaxonWorkerPool
|
||||
from saxon_pool_s9api import SaxonWorkerPoolS9Api
|
||||
@@ -293,6 +297,7 @@ class TransformationJob:
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=120, # 2 Minuten Timeout
|
||||
creationflags=_SUBPROCESS_FLAGS,
|
||||
)
|
||||
|
||||
# Saxon Ausgaben loggen
|
||||
@@ -409,6 +414,7 @@ class TransformationJob:
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=180, # 3 Minuten Timeout
|
||||
creationflags=_SUBPROCESS_FLAGS,
|
||||
)
|
||||
|
||||
# Apache FOP Ausgaben loggen
|
||||
@@ -488,6 +494,7 @@ class TransformationJob:
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=60, # 1 Minute Timeout
|
||||
creationflags=_SUBPROCESS_FLAGS,
|
||||
)
|
||||
|
||||
if result.returncode == 0:
|
||||
@@ -523,6 +530,7 @@ class TransformationJob:
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=90, # 1.5 Minuten Timeout
|
||||
creationflags=_SUBPROCESS_FLAGS,
|
||||
)
|
||||
|
||||
if result_diff.returncode == 0 or self.diff_pdf.exists():
|
||||
|
||||
@@ -17,6 +17,9 @@ from abc import ABC, abstractmethod
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
|
||||
# Verhindert Konsolenfenster bei Subprozessen in PyInstaller-EXE (Windows)
|
||||
_SUBPROCESS_FLAGS = subprocess.CREATE_NO_WINDOW if sys.platform == "win32" else 0
|
||||
|
||||
import psutil
|
||||
|
||||
from worker_metrics import WorkerPoolMetrics
|
||||
@@ -133,7 +136,7 @@ class BaseWorkerPool(ABC):
|
||||
|
||||
logger.debug(f"Kompiliere {self._java_class_name}: {' '.join(javac_cmd[:3])}...")
|
||||
|
||||
result = subprocess.run(javac_cmd, capture_output=True, text=True, timeout=30)
|
||||
result = subprocess.run(javac_cmd, capture_output=True, text=True, timeout=30, creationflags=_SUBPROCESS_FLAGS)
|
||||
if result.returncode != 0:
|
||||
raise RuntimeError(f"Java-Kompilierung fehlgeschlagen: {result.stderr}")
|
||||
|
||||
@@ -174,6 +177,7 @@ class BaseWorkerPool(ABC):
|
||||
stderr=stderr_file,
|
||||
text=True,
|
||||
bufsize=1,
|
||||
creationflags=_SUBPROCESS_FLAGS,
|
||||
)
|
||||
|
||||
self.workers.append(process)
|
||||
|
||||
Reference in New Issue
Block a user