Issue 32392: subprocess.run documentation does not have **kwargs (original) (raw)

Created on 2017-12-20 20:47 by oprypin, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 7289 merged rixx,2018-05-31 20:20
PR 7423 merged miss-islington,2018-06-05 11:43
PR 7489 merged berker.peksag,2018-06-07 19:01
Messages (9)
msg308810 - (view) Author: Oleh Prypin (oprypin) Date: 2017-12-20 20:47
I was just looking at documentation of https://docs.python.org/3.6/library/subprocess.html#subprocess.run and thought that it doesn't support passing `env` because the list of supported keyword arguments is exhaustive (no **kwargs). But it does support passing **kwargs to Popen, so that should be specified in the docs.
msg308823 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2017-12-20 21:26
But the documentation does say "The arguments shown above are merely the most common ones...The full function signature is largely the same as that of the Popen constructor...", no ?
msg308824 - (view) Author: Oleh Prypin (oprypin) Date: 2017-12-20 21:28
Yes, but the most prominent thing to indicate that is **kwargs in the actual function signature. And, as far as I'm concerned, lack of **kwargs means the function signature is exhaustive and there's no point in looking for fine print somewhere in the middle of the textual description.
msg316776 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-05-16 07:53
I agree with Xavier's comment, but I've bitten by this before so I think it would be better if we add more common arguments to the subprocess.run() signature. Adding **kwargs wouldn't be entirely correct since subprocess.run() doesn't pass all its arguments to subprocess.Popen(). Let's add 'env=None' to the signature of subprocess.run(): .. function:: run(args, *, stdin=None, input=None, stdout=None, stderr=None,\ shell=False, cwd=None, timeout=None, check=False, \ encoding=None, errors=None, text=None) https://github.com/python/cpython/blob/3055c947f98a078bd10d6a8cc352048a1b771d60/Doc/library/subprocess.rst#using-the-modsubprocess-module
msg316869 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2018-05-16 21:09
> Let's add 'env=None' to the signature of subprocess.run(): +1
msg318738 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-06-05 11:41
New changeset af1ec97a6d1dde68b2dc0ee9b78965eb219061a8 by Berker Peksag (Tobias Kunze) in branch 'master': bpo-32392: Document env keyword argument of subprocess.run() (GH-7289) https://github.com/python/cpython/commit/af1ec97a6d1dde68b2dc0ee9b78965eb219061a8
msg318740 - (view) Author: miss-islington (miss-islington) Date: 2018-06-05 12:03
New changeset 23b7ee205270320f836e93e411b28ac995cbabf1 by Miss Islington (bot) in branch '3.7': bpo-32392: Document env keyword argument of subprocess.run() (GH-7289) https://github.com/python/cpython/commit/23b7ee205270320f836e93e411b28ac995cbabf1
msg318962 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-06-07 19:22
New changeset 279564431e8e2fa4c20e8850420caea484a5d20b by Berker Peksag in branch '3.6': [3.6] bpo-32392: Document env keyword argument of subprocess.run() (GH-7289) https://github.com/python/cpython/commit/279564431e8e2fa4c20e8850420caea484a5d20b
msg318963 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2018-06-07 19:23
Thanks!
History
Date User Action Args
2022-04-11 14:58:55 admin set github: 76573
2018-06-07 19:23:19 berker.peksag set status: open -> closedresolution: fixedmessages: + stage: patch review -> resolved
2018-06-07 19:22:37 berker.peksag set messages: +
2018-06-07 19:01:05 berker.peksag set pull_requests: + <pull%5Frequest7114>
2018-06-05 12:03:04 miss-islington set nosy: + miss-islingtonmessages: +
2018-06-05 11:43:02 miss-islington set pull_requests: + <pull%5Frequest7048>
2018-06-05 11:41:44 berker.peksag set messages: +
2018-05-31 20:20:01 rixx set keywords: + patchstage: needs patch -> patch reviewpull_requests: + <pull%5Frequest6916>
2018-05-16 21:09:04 xdegaye set messages: +
2018-05-16 07:53:58 berker.peksag set type: enhancementversions: + Python 3.6, Python 3.8keywords: + easynosy: + berker.peksagmessages: + stage: needs patch
2017-12-20 21:28:14 oprypin set messages: +
2017-12-20 21:26:36 xdegaye set nosy: + xdegayemessages: +
2017-12-20 20:47:11 oprypin create