Repository navigation
Fix web searches failing on Windows when the search process exits - #20
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 frompoll()instead of reporting the pipe readable, andsolve_isolateddidn't catch it.solve_isolatednow treats it as the end of the messages.preexec_fnand 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 -qandruff check .passtests/test_io.py