-
Notifications
You must be signed in to change notification settings - Fork 141
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
Added more process arguments #749
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Tests (I copypasted function name OS: CentOS Linux 8 1.py
test.py
test_sync.py
test.py prints:
test_sync.py prints:
|
Test 2: switch back to limiting RAM
If I set
but if I set it to a larger number
This doesn't happen in the same setup with |
Test of trio
Outputs
|
test_asyncio.py
Outputs
|
It doesn't seem to work well on any backend.
Comparing to the full list of # Supported:
args,
stdin,
stdout,
stderr,
cwd,
env,
startupinfo,
creationflags,
start_new_session,
pass_fds,
user,
group,
extra_groups,
umask,
# Not supported:
preexec_fn, # Barely supported by Python (unsafe with threads)
close_fds, # Unsafe (just set it to True and have users use `pass_fds` and `startupinfo.lpAttributeList["handle_list"]` instead)
# Not supported by asyncio:
bufsize,
universal_newlines,
shell,
text,
encoding,
errors,
# _Possible_ remaining contenders to support in AnyIO (AFAIK nobody has requested any of
# these yet):
process_group, # Similar to `start_new_session` in that it can replace `preexec_fn` use cases.
executable,
restore_signals,
pipesize, # Not super useful since if using pipes you should have tasks always reading from the std{out,err} streams. Personally I do not have a use-case for any of those four at the bottom right now, but I wanted to ask why you excluded them. |
Many are outright dangerous, or problematic from the type annotations PoV. I tried to include a larger number of these but gave up on the annotations front. |
Thanks! |
Changes
This adds a number of new arguments to
run_process()
andopen_process()
:startupinfo
creationflags
user
group
extra_groups
umask
Fixes #742.
Checklist
If this is a user-facing code change, like a bugfix or a new feature, please ensure that
you've fulfilled the following conditions (where applicable):
tests/
) added which would fail without your patchdocs/
, in case of behavior changes or newfeatures)
docs/versionhistory.rst
).If this is a trivial change, like a typo fix or a code reformatting, then you can ignore
these instructions.
Updating the changelog
If there are no entries after the last release, use
**UNRELEASED**
as the version.If, say, your patch fixes issue #123, the entry should look like this:
* Fix big bad boo-boo in task groups (#123 <https://github.com/agronholm/anyio/issues/123>_; PR by @yourgithubaccount)
If there's no issue linked, just link to your pull request instead by updating the
changelog after you've created the PR.