[issue24998] docs: subprocess.Popen example has extra/invalid parameter

New submission from Paul Clarke: 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. ---------- assignee: docs@python components: Documentation messages: 249716 nosy: Paul Clarke, docs@python priority: normal severity: normal status: open title: docs: subprocess.Popen example has extra/invalid parameter versions: Python 2.7 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue24998> _______________________________________

Changes by eryksun <eryksun@gmail.com>: ---------- keywords: +easy priority: normal -> low versions: +Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue24998> _______________________________________

Roundup Robot added the comment: 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 ---------- nosy: +python-dev _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue24998> _______________________________________

R. David Murray added the comment: 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...) ---------- nosy: +r.david.murray resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue24998> _______________________________________

Changes by eryksun <eryksun@gmail.com>: ---------- keywords: +easy priority: normal -> low versions: +Python 3.4, Python 3.5, Python 3.6 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue24998> _______________________________________

Roundup Robot added the comment: 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 ---------- nosy: +python-dev _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue24998> _______________________________________

R. David Murray added the comment: 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...) ---------- nosy: +r.david.murray resolution: -> fixed stage: -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue24998> _______________________________________
participants (4)
-
eryksun
-
Paul Clarke
-
R. David Murray
-
Roundup Robot