Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having a shlex example in the subprocess.Popen docs is confusing #58034

Closed
Julian mannequin opened this issue Jan 19, 2012 · 7 comments
Closed

Having a shlex example in the subprocess.Popen docs is confusing #58034

Julian mannequin opened this issue Jan 19, 2012 · 7 comments
Labels
docs Documentation in the Doc dir easy type-feature A feature request or enhancement

Comments

@Julian
Copy link
Mannequin

Julian mannequin commented Jan 19, 2012

BPO 13826
Nosy @merwok, @bitdancer, @sandrotosi, @Julian, @miss-islington
PRs
  • bpo-13826: Clarify Popen constructor example #18438
  • [3.8] bpo-13826: Clarify Popen constructor example (GH-18438) #18445
  • [3.7] bpo-13826: Clarify Popen constructor example (GH-18438) #18446
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-02-10.23:54:57.017>
    created_at = <Date 2012-01-19.14:25:14.888>
    labels = ['easy', 'type-feature', 'docs']
    title = 'Having a shlex example in the subprocess.Popen docs is confusing'
    updated_at = <Date 2020-02-10.23:54:57.017>
    user = 'https://github.com/Julian'

    bugs.python.org fields:

    activity = <Date 2020-02-10.23:54:57.017>
    actor = 'gvanrossum'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2020-02-10.23:54:57.017>
    closer = 'gvanrossum'
    components = ['Documentation']
    creation = <Date 2012-01-19.14:25:14.888>
    creator = 'Julian'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 13826
    keywords = ['patch', 'easy']
    message_count = 7.0
    messages = ['151624', '151627', '151631', '151649', '361741', '361743', '361744']
    nosy_count = 7.0
    nosy_names = ['eric.araujo', 'r.david.murray', 'cvrebert', 'sandro.tosi', 'docs@python', 'Julian', 'miss-islington']
    pr_nums = ['18438', '18445', '18446']
    priority = 'low'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue13826'
    versions = ['Python 3.5', 'Python 3.6']

    @Julian
    Copy link
    Mannequin Author

    Julian mannequin commented Jan 19, 2012

    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.

    @Julian Julian mannequin assigned docspython Jan 19, 2012
    @Julian Julian mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Jan 19, 2012
    @bitdancer
    Copy link
    Member

    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.

    @sandrotosi
    Copy link
    Contributor

    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.

    @Julian
    Copy link
    Mannequin Author

    Julian mannequin commented Jan 19, 2012

    Sounds reasonable to me.

    I'll take a look at adding one unless someone manages to beat me to it.

    @miss-islington
    Copy link
    Contributor

    New changeset 95d024d by Tim D. Smith in branch 'master':
    bpo-13826: Clarify Popen constructor example (GH-18438)
    95d024d

    @miss-islington
    Copy link
    Contributor

    New changeset 78982f9 by Miss Islington (bot) in branch '3.7':
    bpo-13826: Clarify Popen constructor example (GH-18438)
    78982f9

    @miss-islington
    Copy link
    Contributor

    New changeset e6690f6 by Miss Islington (bot) in branch '3.8':
    bpo-13826: Clarify Popen constructor example (GH-18438)
    e6690f6

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir easy type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    5 participants