gh-129005: Avoid copy in _pyio.FileIO.readinto() (#129324)
`os.read()` allocated and filled a buffer by calling `read(2)`, than that data was copied into the user provied buffer. Read directly into the caller's buffer instead by using `os.readinto()`. `os.readinto()` uses `PyObject_GetBuffer()` to make sure the passed in buffer is writeable and bytes-like, drop the manual check.
C
Cody Maloney committed
180ee43bde99b8ce4c4f1d5237ab191e26118061
Parent: 4d0d24f
Committed by GitHub <noreply@github.com>
on 1/28/2025, 11:40:44 AM