Commit 8aca8b6
committed
gh-148402: add missing stacklevel to warnings.warn() in subprocess.Popen
Add stacklevel to two warnings.warn() calls in subprocess.Popen so that
warnings point to the caller's code instead of subprocess.py internals:
- POSIX path (__init__): stacklevel=2
- Windows path (_execute_child): stacklevel=3 (extra frame depth)
Add regression tests that assert warning.filename == __file__.1 parent ba1e1c1 commit 8aca8b6
File tree
3 files changed
+22
-4
lines changed- Lib
- test
- Misc/NEWS.d/next/Library
3 files changed
+22
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
912 | 912 | | |
913 | 913 | | |
914 | 914 | | |
915 | | - | |
| 915 | + | |
916 | 916 | | |
917 | 917 | | |
918 | 918 | | |
| |||
1567 | 1567 | | |
1568 | 1568 | | |
1569 | 1569 | | |
1570 | | - | |
| 1570 | + | |
| 1571 | + | |
1571 | 1572 | | |
1572 | 1573 | | |
1573 | 1574 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3177 | 3177 | | |
3178 | 3178 | | |
3179 | 3179 | | |
| 3180 | + | |
| 3181 | + | |
| 3182 | + | |
| 3183 | + | |
| 3184 | + | |
| 3185 | + | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
| 3189 | + | |
| 3190 | + | |
| 3191 | + | |
3180 | 3192 | | |
3181 | 3193 | | |
3182 | 3194 | | |
| |||
3762 | 3774 | | |
3763 | 3775 | | |
3764 | 3776 | | |
3765 | | - | |
3766 | | - | |
| 3777 | + | |
3767 | 3778 | | |
3768 | 3779 | | |
3769 | 3780 | | |
| |||
3772 | 3783 | | |
3773 | 3784 | | |
3774 | 3785 | | |
| 3786 | + | |
| 3787 | + | |
| 3788 | + | |
3775 | 3789 | | |
3776 | 3790 | | |
3777 | 3791 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments