Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make anyio.run_process() accept stdin argument #859

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jmehnle
Copy link

@jmehnle jmehnle commented Jan 11, 2025

Changes

Make anyio.run_process() accept a stdin argument.

This is consistent with what asyncio.create_subprocess_exec(), trio.run_process(), and subprocess.run(), which accept such an argument.

The handling of conflicts between stdin and input arguments is simplistic: the latter currently overrides the former without warning.

Checklist

  • You've added tests (in tests/) added which would fail without your patch
  • You've updated the documentation (in docs/, in case of behavior changes or new
    features)
  • You've added a new changelog entry (in docs/versionhistory.rst).

This is consistent with what `asyncio.create_subprocess_exec()`, `trio.run_process()`, and `subprocess.run()`, which accept such an argument.

The handling of conflicts between `stdin` and `input` arguments is simplistic: the latter overrides the former without warning.
This new unit test may be able to replace the previously existing `test_run_process_connect_to_file` test, as `run_process()` internally just delegates to `open_process()`, so both are proven working by the new test.
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.

1 participant