You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: Make fcntl usage conditional in mcpm share for Windows compatibility (#166)
The `fcntl` module is not available on Windows, and its direct import
was causing `ImportError` when `mcpm share` was invoked or its module
(src/mcpm/commands/share.py) was loaded on Windows systems.
This commit makes the import and usage of `fcntl` within the
`make_non_blocking` function conditional on `os.name == 'posix'`.
On non-POSIX systems (like Windows), the function will now do nothing.
The existing code for reading from subprocess pipes in `mcpm share`
utilizes `select.select()` with timeouts and handles `IOError`/`OSError`
exceptions. This setup is expected to provide sufficient non-blocking
behavior for reading subprocess output on Windows, even without an
explicit `fcntl` call to set `O_NONBLOCK`.
Note: Full dynamic testing of `mcpm share` on a Windows-like environment
was not possible due to a Python version mismatch (environment: 3.10.17,
project requires: >=3.11) in the available testing sandbox. This change
addresses the direct `ImportError`.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
0 commit comments