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 <noreply@anthropic.com>
This commit is contained in:
Marc Mintel
2026-12-05 20:05:06 +01:00
co-authored by Claude Opus 5.5
parent 9c80002f4b
commit 1562b7f274
+5 -2
View File
@@ -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: