mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-05-12 18:22:53 +08:00
On Windows, when ComfyUI is launched without an attached console (e.g. from a desktop shortcut or detached process), sys.__stdout__ may point to an invalid console handle. Calling flush() on such a handle raises OSError: [Errno 22] Invalid argument, which propagates up through any code that calls print() and crashes every prompt execution. Wrap super().flush() in LogInterceptor.flush() with the same try/except (OSError, ValueError): pass pattern that is already used elsewhere in the codebase for exactly this scenario. A failed flush on a broken console handle just means the line isn't force-drained to that console; content still reaches log_file and the in-memory log buffers. Co-Authored-By: Octopus <liyuan851277048@icloud.com> |
||
|---|---|---|
| .. | ||
| assets | ||
| database | ||
| __init__.py | ||
| app_settings.py | ||
| custom_node_manager.py | ||
| frontend_management.py | ||
| logger.py | ||
| model_manager.py | ||
| node_replace_manager.py | ||
| subgraph_manager.py | ||
| user_manager.py | ||