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.
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:09 | admin | set | github: 66901 |
| 2014年10月23日 19:59:33 | serhiy.storchaka | set | status: open -> closed resolution: rejected messages: + msg229898 stage: resolved |
| 2014年10月23日 19:55:58 | desbma | set | messages: + msg229897 |
| 2014年10月23日 19:19:01 | r.david.murray | set | nosy:
+ r.david.murray, serhiy.storchaka messages: + msg229894 |
| 2014年10月23日 19:02:22 | desbma | create | |