From cbc82026bc8e77df7801638f736fa36d3fb28f6f Mon Sep 17 00:00:00 2001 From: Jason Hoku Date: Wed, 22 Apr 2026 17:33:35 -0700 Subject: [PATCH] fix: route all config_builder prints through safe_print to avoid Windows OSError --- config_builder_node.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/config_builder_node.py b/config_builder_node.py index 3b7041e..f56efd9 100644 --- a/config_builder_node.py +++ b/config_builder_node.py @@ -8,6 +8,7 @@ import os import sys import json import time +import builtins import folder_paths from typing import List, Dict, Any import server @@ -24,7 +25,7 @@ def safe_print(*args, **kwargs): OSError [Errno 22] from Windows console bugs crashing node execution. """ try: - print(*args, **kwargs) + builtins.print(*args, **kwargs) except (OSError, ValueError): try: msg = " ".join(str(a) for a in args) + kwargs.get("end", "\n") @@ -34,6 +35,14 @@ def safe_print(*args, **kwargs): pass # Drop silently — don't crash the node over a log line +# Shadow the module-level `print` so every print() call in this file routes +# through safe_print. Without this, sibling methods (process_lora_array, +# lookup_triggers_endpoint, etc.) still hit the broken stdout and crash with +# OSError [Errno 22] on Windows — the local `print = safe_print` in +# generate_config only covers that one function. +print = safe_print + + # =============================================================================