fix(operator): resolve Windows select.select OSError during TTY stdin…#4
Open
Adityakk9031 wants to merge 2 commits into
Open
fix(operator): resolve Windows select.select OSError during TTY stdin…#4Adityakk9031 wants to merge 2 commits into
Adityakk9031 wants to merge 2 commits into
Conversation
Author
|
@jeqcho have a look |
Contributor
|
Thanks for the fix, and for routing the Windows path through msvcrt instead of trying to make select work where it can't. Tests all pass; the only red is formatting. Run |
Author
|
@jeqcho please review again |
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.
Fixes #3
Summary
Fixes a crash when running interactive or attended evaluations on Windows hosts.
On Windows (
sys.platform == "win32"), Python's standard libraryselect.select()only supports socket objects. Calling:on a standard input stream raises:
causing step 0 to fail immediately during TTY stdin polling.
Proposed Changes
Windows
msvcrtPolling: Updated_drain_stdin()anddefault_poll_end()insrc/inspect_robots_franka/operator.pyto checksys.platform == "win32"and usemsvcrt.kbhit()andmsvcrt.getwch().OSError Handling: Wrapped Unix
select.select()polling intry...except OSError:blocks so non-socket standard streams on Windows or exotic TTY streams fail gracefully rather than crashing.Verification
Unit Tests: Executed
python -m pytest -o pythonpath=src --cov=src— 101 tests passed.Coverage: Maintained 100% statement and branch coverage across the package.