Title: Having a shlex example in the subprocess.Popen docs is confusing
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.6, Python 3.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Julian, cvrebert, docs@python, eric.araujo, miss-islington, r.david.murray, sandro.tosi
Priority: low Keywords: easy, patch

Created on 2012-01-19 14:25 by Julian, last changed 2020-02-10 23:54 by gvanrossum. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 18438 merged tdsmith, 2020-02-10 20:50
PR 18445 merged miss-islington, 2020-02-10 22:51
PR 18446 merged miss-islington, 2020-02-10 22:51
Messages (7)
msg151624 - (view) Author: Julian Berman (Julian) * Date: 2012-01-19 14:25
The example at 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.
msg151627 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-01-19 14:36
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.
msg151631 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2012-01-19 14:45
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.
msg151649 - (view) Author: Julian Berman (Julian) * Date: 2012-01-19 19:41
Sounds reasonable to me.

I'll take a look at adding one unless someone manages to beat me to it.
msg361741 - (view) Author: miss-islington (miss-islington) Date: 2020-02-10 22:51
New changeset 95d024d585bd3ed627437a2f0cbc783c8a014c8a by Tim D. Smith in branch 'master':
bpo-13826: Clarify Popen constructor example (GH-18438)
msg361743 - (view) Author: miss-islington (miss-islington) Date: 2020-02-10 22:56
New changeset 78982f94faaa05e363d15b49ec230d11a4d8bebd by Miss Islington (bot) in branch '3.7':
bpo-13826: Clarify Popen constructor example (GH-18438)
msg361744 - (view) Author: miss-islington (miss-islington) Date: 2020-02-10 22:57
New changeset e6690f6cd1b0c2bd5804bad30239a4070f79102c by Miss Islington (bot) in branch '3.8':
bpo-13826: Clarify Popen constructor example (GH-18438)
Date User Action Args
2020-02-10 23:54:57gvanrossumsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-02-10 22:57:09miss-islingtonsetmessages: + msg361744
2020-02-10 22:56:18miss-islingtonsetmessages: + msg361743
2020-02-10 22:51:25miss-islingtonsetpull_requests: + pull_request17820
2020-02-10 22:51:16miss-islingtonsetpull_requests: + pull_request17819
2020-02-10 22:51:05miss-islingtonsetnosy: + miss-islington
messages: + msg361741
2020-02-10 20:50:10tdsmithsetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request17812
2016-04-19 00:07:35berker.peksagsetkeywords: + easy
stage: needs patch
versions: + Python 3.5, Python 3.6, - Python 2.7, Python 3.2, Python 3.3
2014-05-16 05:54:47cvrebertsetnosy: + cvrebert
2012-02-03 14:35:00eric.araujosetnosy: + eric.araujo
2012-01-19 19:41:57Juliansetmessages: + msg151649
2012-01-19 14:45:46sandro.tosisetnosy: + sandro.tosi

messages: + msg151631
versions: - Python 2.6, Python 3.1
2012-01-19 14:37:14r.david.murraysetpriority: normal -> low
2012-01-19 14:36:48r.david.murraysetnosy: + r.david.murray
messages: + msg151627
2012-01-19 14:25:14Juliancreate