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: docs: subprocess.Popen example has extra/invalid parameter
Type: Stage: resolved
Components: Documentation Versions: Python 3.6, Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Paul Clarke, docs@python, python-dev, r.david.murray
Priority: low Keywords: easy

Created on 2015-09-04 05:11 by Paul Clarke, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg249716 - (view) Author: Paul Clarke (Paul Clarke) Date: 2015-09-04 05:11
in "subprocess" module documentation has a section for "replacing older functions with subprocess", specifically 17.1.4.5 "replacing os.popen", which includes the example on "return code handling", specifically this line:
--
process = Popen("cmd", 'w', shell=True, stdin=PIPE)
--

That 'w' shouldn't be there.
msg249761 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-09-04 14:03
New changeset 0ff7aa9a438f by R David Murray in branch '2.7':
#24998: fix cut and paste error in subprocess example.
https://hg.python.org/cpython/rev/0ff7aa9a438f

New changeset 47e711a7416b by R David Murray in branch '3.4':
#24998: fix cut and paste error in subprocess example.
https://hg.python.org/cpython/rev/47e711a7416b

New changeset fa53edb32962 by R David Murray in branch '3.5':
Merge: #24998: fix cut and paste error in subprocess example.
https://hg.python.org/cpython/rev/fa53edb32962

New changeset 75e10a5cbf43 by R David Murray in branch 'default':
Merge: #24998: fix cut and paste error in subprocess example.
https://hg.python.org/cpython/rev/75e10a5cbf43
msg249762 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-09-04 14:05
Thanks for the report.  I'm surprised that hasn't been noticed before.  I'm also wondering why the 'shell=True' was removed from the example in the python3 docs (and why whoever did that didn't notice the bug :), but that would be a separate issue (someone would need to figure out why the change was made before undoing it...)
History
Date User Action Args
2022-04-11 14:58:20adminsetgithub: 69186
2015-09-04 14:05:52r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg249762

resolution: fixed
stage: resolved
2015-09-04 14:03:44python-devsetnosy: + python-dev
messages: + msg249761
2015-09-04 06:53:14eryksunsetkeywords: + easy
priority: normal -> low
versions: + Python 3.4, Python 3.5, Python 3.6
2015-09-04 05:11:54Paul Clarkecreate