GH-134453: Fix subprocess memoryview input handling on POSIX (GH-134949)
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: - 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.
G
Gregory P. Smith committed
cc6bc4c97f7be5b401a91119ba603e6c1a07c99b
Parent: 526d7a8
Committed by GitHub <noreply@github.com>
on 11/29/2025, 4:25:06 AM