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: subprocess.run(cmd, input='text') should pass universal_newlines=True to Popen
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.6
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: akira, gregory.p.smith, ukarroum
Priority: normal Keywords: patch

Created on 2016-06-08 23:59 by akira, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
text_input.diff akira, 2016-06-08 23:59 review
Messages (3)
msg267936 - (view) Author: Akira Li (akira) * Date: 2016-06-08 23:59
At the moment, subprocess.run(cmd, input='text') raises TypeError.
It would be nice if universal_newlines=isinstance(input, str) if *input* is set.

I've attached a corresponding patch with the necessary changes to the docs, tests and the subprocess.run() code.
msg410418 - (view) Author: Yassir Karroum (ukarroum) * Date: 2022-01-12 18:03
As of 3.7, the subprocess.run has a new parameter "text".

IMO it's safer to explicitly set the "text" value instead of inferring it from the "input" type.
msg410428 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2022-01-12 20:00
agreed.
History
Date User Action Args
2022-04-11 14:58:32adminsetgithub: 71460
2022-01-12 20:00:21gregory.p.smithsetstatus: open -> closed
resolution: rejected
messages: + msg410428

stage: patch review -> resolved
2022-01-12 18:03:15ukarroumsetnosy: + ukarroum
messages: + msg410418
2016-06-17 09:22:51ned.deilysetnosy: + gregory.p.smith

stage: patch review
2016-06-08 23:59:23akiracreate