Skip to content

Documentation for subprocess.Popen()'s "user", "group", "extra_groups" args may need more usage info #94632

Open

Description

@ald-extrahop

It's very easy for someone that doesn't really understand the details of how to drop privileges (e.g. me) to use the "user", "group", and "extra_groups" args to subprocess.Popen() incorrectly ... or at least not in a way that gets the results they expect. Since there are potentially many reasonable patterns for using these It might be at least worth documenting that just setting "user" isn't a replacement for running a command under su or runuser.

Linked PRs

Activity

  1. added 3 commits that reference this issue on Apr 5, 2026
  2. added 5 commits that reference this issue on Apr 5, 2026
  3. gpshead commented on Apr 5, 2026

    @gpshead
    Member

    Leaving this open as my PR only addressed one caveat, there's still a lot of room to make documenting this better.

    The current state of things is that these were added and documented as making particular POSIX system calls. But that doesn't really do a good job of explaining what happens to users who are not intimately familiar with those semantics.

  4. added 2 commits that reference this issue on Apr 5, 2026
  5. added 2 commits that reference this issue on Apr 5, 2026
  6. added a commit that references this issue on Apr 25, 2026
  7. added a commit that references this issue on Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dirtopic-subprocessSubprocess issues.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions