This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add 'input' argument to subprocess.check_call and subprocess.call
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.5
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: desbma, r.david.murray, serhiy.storchaka
Priority: normal Keywords:

Created on 2014-10-23 19:02 by desbma, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg229889 - (view) Author: desbma (desbma) * Date: 2014-10-23 19:02
Python 3.4 added a 'input' argument to the subprocess.check_output function to send bytes to stdin, but it was surprisingly not added to other subprocess helpers.

The same functionality should be added to subprocess.check_call and subprocess.call.
msg229894 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-10-23 19:19
call and check_call are designed as APIs that do *not* manage the standard streams of the commands called.  If you want to manage the streams, either use check_output or Popen directly.

Internally, call and check call do *not* use communicate, and it is communicate that supports the input parameter.  The better way to support input for call and check_call would be to implement the full proposal advanced by Serhiy in issue 16624 (and deprecate 'input' entirely).

So, I think this should either be rejected, or turned into an enhancement request for Serhiy's proposal.
msg229897 - (view) Author: desbma (desbma) * Date: 2014-10-23 19:55
I think the 'stdin argument can be any file like or stream for all subprocess functions' approach would be the best solution, because it is misleading to differentiate behavior based on internal implementation details (the use of communicate), when the function names are so close and are expected to have a similar behavior.

It's not that I really need or miss the input argument for check call and call (as you said it is easy to circumvent). 
The issue IMO is that it is unintuitive that it is available for check_output and not others.
msg229898 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-10-23 19:59
Then I'm closing this issue.
History
Date User Action Args
2022-04-11 14:58:09adminsetgithub: 66901
2014-10-23 19:59:33serhiy.storchakasetstatus: open -> closed
resolution: rejected
messages: + msg229898

stage: resolved
2014-10-23 19:55:58desbmasetmessages: + msg229897
2014-10-23 19:19:01r.david.murraysetnosy: + r.david.murray, serhiy.storchaka
messages: + msg229894
2014-10-23 19:02:22desbmacreate