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) *  |
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) *  |
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) *  |
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) *  |
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) *  |
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) *  |
Date: 2018-06-07 19:23 |
Thanks! |
|
|