Skip to content

Fix web searches failing on Windows when the search process exits - #20

Merged
ore-codes merged 1 commit into
masterfrom
windows-search-pipe
Nov 26, 2026
Merged

ore-codes merged 1 commit into
masterfrom
windows-search-pipe

Conversation

@ore-codes

Copy link
Copy Markdown
Owner

What this changes

On Windows, web searches could fail with BrokenPipeError ([WinError 109]). Once the search process closes its end of the pipe, Windows raises that error from poll() instead of reporting the pipe readable, and solve_isolated didn't catch it.

  • solve_isolated now treats it as the end of the messages.
  • It checks whether the child is alive before reading, instead of polling the pipe a second time after the child has exited.
  • The CLI Ctrl-C test is skipped on Windows, because it relies on preexec_fn and sending SIGINT to a child.

How you checked it

On Windows with Python 3.12: before the change 13 tests failed; after it, 283 passed and 50 were skipped. CI runs on Linux only, so it covers the unchanged-behaviour side. Ctrl-C in the CLI on Windows was not checked.

  • pytest -q and ruff check . pass
  • Solver or model change: brute-force tests extended
  • Parser change: fixture added to tests/test_io.py
  • Export change: result opened in draw.io, Excalidraw or mermaid.live

Once the child's end of the pipe is closed, Windows raises BrokenPipeError
from poll() instead of reporting the pipe readable, so a finished search
ended in an error.  Treat it as the end of the messages, and check whether
the child is alive before reading instead of polling a second time.

Skip the CLI Ctrl-C test on Windows, which cannot send SIGINT to a child.
@ore-codes
ore-codes enabled auto-merge November 26, 2026 08:44
@ore-codes
ore-codes merged commit c145b8b into master Nov 26, 2026
6 checks passed
@ore-codes
ore-codes deleted the windows-search-pipe branch November 26, 2026 08:45
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