Skip to content

fix(operator): resolve Windows select.select OSError during TTY stdin…#4

Open
Adityakk9031 wants to merge 2 commits into
robocurve:mainfrom
Adityakk9031:#3
Open

fix(operator): resolve Windows select.select OSError during TTY stdin…#4
Adityakk9031 wants to merge 2 commits into
robocurve:mainfrom
Adityakk9031:#3

Conversation

@Adityakk9031

@Adityakk9031 Adityakk9031 commented Jul 21, 2026

Copy link
Copy Markdown

Fixes #3

Summary

Fixes a crash when running interactive or attended evaluations on Windows hosts.

On Windows (sys.platform == "win32"), Python's standard library select.select() only supports socket objects. Calling:

select.select([sys.stdin], [], [], 0)

on a standard input stream raises:

OSError: [WinError 10038] An operation was attempted on something that is not a socket

causing step 0 to fail immediately during TTY stdin polling.


Proposed Changes

  • Windows msvcrt Polling: Updated _drain_stdin() and default_poll_end() in src/inspect_robots_franka/operator.py to check sys.platform == "win32" and use msvcrt.kbhit() and msvcrt.getwch().

  • OSError Handling: Wrapped Unix select.select() polling in try...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=src101 tests passed.

  • Coverage: Maintained 100% statement and branch coverage across the package.

@Adityakk9031

Copy link
Copy Markdown
Author

@jeqcho have a look

@jeqcho

jeqcho commented Jul 21, 2026

Copy link
Copy Markdown
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 uv run ruff format . (it wants to reformat src/inspect_robots_franka/operator.py), commit, and push. CI should go green after that.

@Adityakk9031

Copy link
Copy Markdown
Author

@jeqcho please review again

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.

OSError: [WinError 10038] during non-blocking TTY stdin polling on Windows

2 participants