bugfix
This commit is contained in:
@@ -3909,8 +3909,16 @@ def main():
|
||||
debug_print(f"Gesamtdauer: {duration:.2f} Sekunden.")
|
||||
debug_print(f"===== Skript beendet =====")
|
||||
if LOG_FILE:
|
||||
try: with open(LOG_FILE, "a", encoding="utf-8") as f: f.write(f"[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] ===== Skript wirklich beendet =====\n")
|
||||
except: pass
|
||||
try:
|
||||
# 'with' startet in der nächsten Zeile
|
||||
with open(LOG_FILE, "a", encoding="utf-8") as f:
|
||||
f.write(f"[{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] ===== Skript wirklich beendet =====\n")
|
||||
except Exception as e:
|
||||
# Optional: Warnung ausgeben, wenn das finale Schreiben fehlschlägt
|
||||
print(f"[WARNUNG] Konnte letzte Log-Nachricht nicht schreiben: {e}")
|
||||
pass # Programm soll trotzdem normal beenden
|
||||
# --- ENDE KORRIGIERTER BLOCK ---
|
||||
|
||||
print(f"Verarbeitung abgeschlossen. Logfile: {LOG_FILE}")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user