[issue13826] Having a shlex example in the subprocess.Popen docs is confusing

New submission from Julian Berman <Julian+Python.org@GrayVines.com>: The example at http://docs.python.org/dev/library/subprocess.html#popen-constructor seems a bit misplaced, as it seems to suggest that one should use the shlex module. Most of the other examples in the module seem to use a list to provide the args, so if there was a need to just point out that shlex could be used for a corner case perhaps it'd be better suited as a footnote or another subsection somewhere. ---------- assignee: docs@python components: Documentation messages: 151624 nosy: Julian, docs@python priority: normal severity: normal status: open title: Having a shlex example in the subprocess.Popen docs is confusing type: enhancement versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13826> _______________________________________

R. David Murray <rdmurray@bitdance.com> added the comment: It is not particularly intuitive what goes in to a Popen non-shell argument list, unless you are an experienced programmer. The real purpose of the note is to convey a lot of information about how tokenization works in a short example, and it also demonstrates how to investigate other complex cases the user may have to deal with. Because of the first part of that (showing tokenization quirks) I don't think it should be relegated to a footnote. That said, the example could perhaps be reworded slightly to make its expositional purpose clearer. Suggestions welcome. ---------- nosy: +r.david.murray _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13826> _______________________________________

Changes by R. David Murray <rdmurray@bitdance.com>: ---------- priority: normal -> low _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13826> _______________________________________

Sandro Tosi <sandro.tosi@gmail.com> added the comment: Maybe we can add a very small example before the whole note to show just how to use Popen in simple situation, and so the shlex part below will add more details for more advanced cases. ---------- nosy: +sandro.tosi versions: -Python 2.6, Python 3.1 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13826> _______________________________________

Julian Berman <Julian+Python.org@GrayVines.com> added the comment: Sounds reasonable to me. I'll take a look at adding one unless someone manages to beat me to it. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13826> _______________________________________

Changes by Éric Araujo <merwok@netwok.org>: ---------- nosy: +eric.araujo _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13826> _______________________________________

Changes by Chris Rebert <pybugs@rebertia.com>: ---------- nosy: +cvrebert _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13826> _______________________________________

Changes by Berker Peksag <berker.peksag@gmail.com>: ---------- keywords: +easy stage: -> needs patch versions: +Python 3.5, Python 3.6 -Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13826> _______________________________________

Change by Tim Smith <pythonbugs@tim-smith.us>: ---------- keywords: +patch pull_requests: +17812 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18438 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue13826> _______________________________________

miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset 95d024d585bd3ed627437a2f0cbc783c8a014c8a by Tim D. Smith in branch 'master': bpo-13826: Clarify Popen constructor example (GH-18438) https://github.com/python/cpython/commit/95d024d585bd3ed627437a2f0cbc783c8a0... ---------- nosy: +miss-islington _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue13826> _______________________________________

Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +17819 pull_request: https://github.com/python/cpython/pull/18445 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue13826> _______________________________________

Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +17820 pull_request: https://github.com/python/cpython/pull/18446 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue13826> _______________________________________

miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset 78982f94faaa05e363d15b49ec230d11a4d8bebd by Miss Islington (bot) in branch '3.7': bpo-13826: Clarify Popen constructor example (GH-18438) https://github.com/python/cpython/commit/78982f94faaa05e363d15b49ec230d11a4d... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue13826> _______________________________________

miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset e6690f6cd1b0c2bd5804bad30239a4070f79102c by Miss Islington (bot) in branch '3.8': bpo-13826: Clarify Popen constructor example (GH-18438) https://github.com/python/cpython/commit/e6690f6cd1b0c2bd5804bad30239a4070f7... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue13826> _______________________________________

Change by Guido van Rossum <guido@python.org>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue13826> _______________________________________

R. David Murray <rdmurray@bitdance.com> added the comment: It is not particularly intuitive what goes in to a Popen non-shell argument list, unless you are an experienced programmer. The real purpose of the note is to convey a lot of information about how tokenization works in a short example, and it also demonstrates how to investigate other complex cases the user may have to deal with. Because of the first part of that (showing tokenization quirks) I don't think it should be relegated to a footnote. That said, the example could perhaps be reworded slightly to make its expositional purpose clearer. Suggestions welcome. ---------- nosy: +r.david.murray _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13826> _______________________________________

Changes by R. David Murray <rdmurray@bitdance.com>: ---------- priority: normal -> low _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13826> _______________________________________

Sandro Tosi <sandro.tosi@gmail.com> added the comment: Maybe we can add a very small example before the whole note to show just how to use Popen in simple situation, and so the shlex part below will add more details for more advanced cases. ---------- nosy: +sandro.tosi versions: -Python 2.6, Python 3.1 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13826> _______________________________________

Julian Berman <Julian+Python.org@GrayVines.com> added the comment: Sounds reasonable to me. I'll take a look at adding one unless someone manages to beat me to it. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13826> _______________________________________

Changes by Éric Araujo <merwok@netwok.org>: ---------- nosy: +eric.araujo _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13826> _______________________________________

Changes by Chris Rebert <pybugs@rebertia.com>: ---------- nosy: +cvrebert _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13826> _______________________________________

Changes by Berker Peksag <berker.peksag@gmail.com>: ---------- keywords: +easy stage: -> needs patch versions: +Python 3.5, Python 3.6 -Python 2.7, Python 3.2, Python 3.3 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue13826> _______________________________________

Change by Tim Smith <pythonbugs@tim-smith.us>: ---------- keywords: +patch pull_requests: +17812 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18438 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue13826> _______________________________________

miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset 95d024d585bd3ed627437a2f0cbc783c8a014c8a by Tim D. Smith in branch 'master': bpo-13826: Clarify Popen constructor example (GH-18438) https://github.com/python/cpython/commit/95d024d585bd3ed627437a2f0cbc783c8a0... ---------- nosy: +miss-islington _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue13826> _______________________________________

Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +17819 pull_request: https://github.com/python/cpython/pull/18445 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue13826> _______________________________________

Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +17820 pull_request: https://github.com/python/cpython/pull/18446 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue13826> _______________________________________

miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset 78982f94faaa05e363d15b49ec230d11a4d8bebd by Miss Islington (bot) in branch '3.7': bpo-13826: Clarify Popen constructor example (GH-18438) https://github.com/python/cpython/commit/78982f94faaa05e363d15b49ec230d11a4d... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue13826> _______________________________________

miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset e6690f6cd1b0c2bd5804bad30239a4070f79102c by Miss Islington (bot) in branch '3.8': bpo-13826: Clarify Popen constructor example (GH-18438) https://github.com/python/cpython/commit/e6690f6cd1b0c2bd5804bad30239a4070f7... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue13826> _______________________________________

Change by Guido van Rossum <guido@python.org>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue13826> _______________________________________
participants (9)
-
Berker Peksag
-
Chris Rebert
-
Guido van Rossum
-
Julian Berman
-
miss-islington
-
R. David Murray
-
Sandro Tosi
-
Tim Smith
-
Éric Araujo