Skip to content

Conversation

@gpshead
Copy link
Member

@gpshead gpshead commented Nov 29, 2025

When the stdin being used by a :subprocess.Popen instance is closed, this is now ignored in subprocess.Popen.communicate() instead of leaving the class in an inconsistent state.

Closes #74389

…nores stdin.flush error when closed

with a unittest and news entry.
@gpshead gpshead force-pushed the subprocess-ignore-valueerror-stdin-flush branch from de0be58 to 774cb71 Compare November 29, 2025 04:35
@gpshead gpshead marked this pull request as ready for review November 29, 2025 04:36
@gpshead gpshead self-assigned this Nov 29, 2025
@gpshead gpshead added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes topic-subprocess Subprocess issues. type-bug An unexpected behavior, bug, or error labels Nov 29, 2025
@gpshead gpshead enabled auto-merge (squash) November 29, 2025 04:38
@gpshead gpshead merged commit 923056b into python:main Nov 29, 2025
56 checks passed
@miss-islington-app
Copy link

Thanks @gpshead for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 29, 2025
…nores stdin.flush error when closed (pythonGH-142061)

pythongh-70560: pythongh-74389: subprocess.Popen.communicate() now ignores stdin.flush error when closed

with a unittest and news entry.
(cherry picked from commit 923056b)

Co-authored-by: Gregory P. Smith <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Nov 29, 2025

GH-142064 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Nov 29, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 29, 2025
…nores stdin.flush error when closed (pythonGH-142061)

pythongh-70560: pythongh-74389: subprocess.Popen.communicate() now ignores stdin.flush error when closed

with a unittest and news entry.
(cherry picked from commit 923056b)

Co-authored-by: Gregory P. Smith <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Nov 29, 2025

GH-142065 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Nov 29, 2025
@gpshead gpshead deleted the subprocess-ignore-valueerror-stdin-flush branch November 29, 2025 06:25
gpshead added a commit that referenced this pull request Nov 29, 2025
… stdin.flush error when closed (GH-142061) (#142064)

gh-74389: gh-70560: subprocess.Popen.communicate() now ignores stdin.flush error when closed (GH-142061)

gh-70560: gh-74389: subprocess.Popen.communicate() now ignores stdin.flush error when closed

with a unittest and news entry.
(cherry picked from commit 923056b)

Co-authored-by: Gregory P. Smith <[email protected]>
gpshead added a commit that referenced this pull request Nov 29, 2025
… stdin.flush error when closed (GH-142061) (#142065)

gh-74389: gh-70560: subprocess.Popen.communicate() now ignores stdin.flush error when closed (GH-142061)

gh-70560: gh-74389: subprocess.Popen.communicate() now ignores stdin.flush error when closed

with a unittest and news entry.
(cherry picked from commit 923056b)

Co-authored-by: Gregory P. Smith <[email protected]>
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
…nores stdin.flush error when closed (pythonGH-142061)

pythongh-70560: pythongh-74389: subprocess.Popen.communicate() now ignores stdin.flush error when closed

with a unittest and news entry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic-subprocess Subprocess issues. type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError in Popen.communicate()

1 participant