python / python/typeshed

subprocess.Popen: overloads for set stdin/stdout/stderr attributes?

Open
#3,831 4 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

topic: io
Dominant language
Python
Stars
5.1k
Forks
2.1k
Avg merge
1d 19h
Merged PRs (30d)
82

Description

When passing in stdin, stdout, or stderr those attributes are also set on the Popen instances, i.e. not Optional/None.

Given the many overloads there are already (https://github.com/python/typeshed/blob/2d82e1fb8bcedc75be3ae91f911472931c92490a/stdlib/3/subprocess.pyi#L844-L1156) and that this would (AFAIK) have to multiply them, this might not really be feasible/practical though?

Ref: https://github.com/python/typeshed/commit/76b295a66919dcb3719e73011747dbcbc321c1d3 made them Optional by default.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with stdlib/3/subprocess.pyi, especially the Popen overloads around lines 844-1156, and compare them with the referenced commit that made the attributes Optional by default. Determine how overloads could represent the stdin, stdout, and stderr arguments without multiplying impractically. Done means passed streams are reflected as non-Optional attributes while the existing overload behavior remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.