vanminhandClaude Opus 5 74a7b98691 Bound serial close so a dead port cannot hang the run
When a USB-serial adapter disappears mid-run, writes to the open handle
fail with PermissionError, but serial.close() can block forever. Cleanup
then wedged after the second port closed and Ctrl+C could not break out,
because the main thread was stuck inside a blocking Windows call.

Close on a daemon thread and give up after CLOSE_TIMEOUT_S, so an
abandoned port can never hold up the exit.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 15:11:36 +08:00
2026-09-23 10:07:00 +08:00
2026-09-23 10:07:00 +08:00
S
Description
No description provided
91 KiB
Languages
Python 100%