From 1562b7f274922c9cfcaa35f3a704d24152e06191 Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Sat, 5 Dec 2026 20:05:06 +0100 Subject: [PATCH] antworten.py: full environment without inherited MOTOR_ switches (Windows needs SystemRoot etc.), no console window on Windows; stdin already written from a thread Co-Authored-By: Claude Opus 5.5 --- entscheiden/motor/richter_lock/antworten.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/entscheiden/motor/richter_lock/antworten.py b/entscheiden/motor/richter_lock/antworten.py index 9f8b581c..9caed6ff 100644 --- a/entscheiden/motor/richter_lock/antworten.py +++ b/entscheiden/motor/richter_lock/antworten.py @@ -144,7 +144,9 @@ def main(): return teile(a) pfade = [tuple(p.split("=", 1)) for p in a.pfad] + PFADE s = wirksam(zeile_von(a.zeile), pfade, a.speicher, a.temperatur_ms, a.ohne_frist) - env = {"HOME": os.environ["HOME"], "PATH": os.environ["PATH"], "RAYON_NUM_THREADS": str(a.faeden)} + # volle Umgebung (Windows braucht SystemRoot, TEMP usw.), aber ohne geerbte Motor-Schalter: es gilt nur die Zeile der Fassung + env = {k: v for k, v in os.environ.items() if not k.startswith("MOTOR_")} + env["RAYON_NUM_THREADS"] = str(a.faeden) env.update(s) d = a.daten cmd = ([] if WIN else ["nice", "-n", "5"]) + [a.exe, "dienst", "sechs100", d, "2000-600-400", "200", f"{d}/sechs100-v2.bin", "genau", @@ -174,7 +176,8 @@ def main(): halter, _platz = motorplatz.nimm(motorplatz.PLAETZE) t0 = time.time() try: - p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=open(a.aus + ".log", "wb"), env=env) + p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=open(a.aus + ".log", "wb"), env=env, + creationflags=(0x08000000 | 0x4000) if WIN else 0) # Eingabe in einem eigenen Faden schreiben: schreibt man erst alles und liest dann, blockieren beide, sobald die Ausgabe den Pipe-Puffer fuellt def schreiben(): try: