Skip to content

fix(launcher): usable stdio under pythonw - headless tray failed to bind the UI port#199

Merged
mbachaud merged 1 commit into
masterfrom
fix/headless-stdio
Jun 9, 2026
Merged

fix(launcher): usable stdio under pythonw - headless tray failed to bind the UI port#199
mbachaud merged 1 commit into
masterfrom
fix/headless-stdio

Conversation

@mbachaud

@mbachaud mbachaud commented Jun 9, 2026

Copy link
Copy Markdown
Owner

v0.7.0 hotfix, caught during the local tray install: a detached pythonw start has sys.stdout/stderr = None, uvicorn's default loggers write to them, and the launcher's uvicorn thread died before binding :11438 (tray icon alive, dashboard dead, no traceback). _ensure_streams() gives the process usable streams (the --log-file, else devnull) right after arg parsing. 2 new tests; 52 passed across launcher suites.

…ind the UI port

A detached pythonw start has sys.stdout/sys.stderr = None; uvicorn's
default logging config writes to those streams, so the launcher's own
uvicorn thread died before binding :11438 (observed live during the
v0.7.0 install: ':11438 did not bind within 3.0s' with no traceback,
tray icon up, dashboard dead). _ensure_streams() routes the missing
streams into --log-file (or os.devnull) right after arg parsing, so
every print/StreamHandler in the stack stays harmless when headless.

2 new tests.
@mbachaud mbachaud merged commit 67cb31d into master Jun 9, 2026
3 checks passed
@mbachaud mbachaud deleted the fix/headless-stdio branch June 9, 2026 21:48
@mbachaud mbachaud mentioned this pull request Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant