Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.5k
[3.13] GH-134453: Fix subprocess memoryview input handling on POSIX (GH-134949)#142063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
+51 −2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
…ythonGH-134949)Fix inconsistent subprocess.Popen.communicate() behavior between Windowsand POSIX when using memoryview objects with non-byte elements as input.On POSIX systems, the code was incorrectly comparing bytes written againstelement count instead of byte count, causing data truncation for largeinputs with non-byte element types.Changes:- Cast memoryview inputs to byte view when input is already a memoryview- Fix progress tracking to use len(input_view) instead of len(self._input)- Add comprehensive test coverage for memoryview inputs🤖 Generated with [Claude Code](https://claude.ai/code)Co-Authored-By: Claude <noreply@anthropic.com>* old-man-yells-at-ReST* Update 2025-05-30-18-37-44.gh-issue-134453.kxkA-o.rst* assertIsNone review feedback* fix memoryview_nonbytes test to fail without our fix on main, and have a nicer error.Thanks to Peter Bierma@ZeroIntensity for the code review.(cherry picked from commit cc6bc4c97f7be5b401a91119ba603e6c1a07c99b)Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
This was referencedNov 29, 2025
704bb69 intopython:3.13 74 of 76 checks passed
Uh oh!
There was an error while loading.Please reload this page.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading.Please reload this page.
Fix inconsistent subprocess.Popen.communicate() behavior between Windows
and POSIX when using memoryview objects with non-byte elements as input.
On POSIX systems, the code was incorrectly comparing bytes written against
element count instead of byte count, causing data truncation for large
inputs with non-byte element types.
Changes:
🤖 Generated withClaude Code
Co-Authored-By: Claudenoreply@anthropic.com
Thanks to Peter Bierma@ZeroIntensity for the code review.
(cherry picked from commitcc6bc4c)
Co-authored-by: Gregory P. Smith68491+gpshead@users.noreply.github.com
subprocess.Popen.communicate()behavior between Windows and Posix on non-byte memoryview input #134453