Skip to content

fix: skip user parameter in open_process on Windows#616

Open
Br1an67 wants to merge 1 commit intoanthropics:mainfrom
Br1an67:fix/issue-546-windows-user-param
Open

fix: skip user parameter in open_process on Windows#616
Br1an67 wants to merge 1 commit intoanthropics:mainfrom
Br1an67:fix/issue-546-windows-user-param

Conversation

@Br1an67
Copy link

@Br1an67 Br1an67 commented Mar 1, 2026

Summary

On Windows, passing the user parameter to anyio.open_process() raises NotImplementedError because asyncio's subprocess transport does not support running processes as a different user on Windows.

Fixes #546

Changes

  • Conditionally include the user parameter only on non-Windows platforms in SubprocessCLITransport._start_process()
  • Added test to verify user is not passed to open_process when platform is Windows

Testing

  • All 161 tests pass (160 existing + 1 new)
  • ruff check passes with no issues
  • The fix is backward-compatible — Unix/Linux behavior is unchanged

The `user` parameter for running subprocesses as a different user is
not supported on Windows and causes `NotImplementedError` in asyncio's
subprocess transport.

Conditionally include the `user` parameter only on non-Windows
platforms so the SDK works on Windows.
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.

NotImplementedError - user parameter not supported in subprocess creation

1 participant