subprocess.Popen: warnings.warn() calls missing stacklevel=2
Open
Nobody has claimed this yet.
stdlib
topic-multiprocessing
type-bug
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Both warnings.warn() calls in subprocess.Popen.__init__ are missing stacklevel=2:
- POSIX path (line 915): Warning when
pass_fdsoverridesclose_fds - Windows path (line 1569): Warning when
startupinfo.lpAttributeList['handle_list']overridesclose_fds
Without stacklevel=2, the warning points to an internal line inside subprocess.py rather than the caller's Popen() invocation, making it harder for users to locate the source.
PR: #148400
Linked PRs
- gh-148400
- gh-148668
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in subprocess.py at the POSIX and Windows warnings.warn() calls identified at lines 915 and 1569, and review PR #148400 for existing work. The change is complete when both warnings point to the caller's Popen() invocation rather than an internal subprocess.py line.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 25/100