diff options
author | Cody Maloney <cmaloney@users.noreply.github.com> | 2025-01-28 11:40:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-28 11:40:44 (GMT) |
commit | 180ee43bde99b8ce4c4f1d5237ab191e26118061 (patch) | |
tree | 04b129095b05a4f778c8c1911c79b40900e7035d /Python/sysmodule.c | |
parent | 4d0d24f6e3dff2864007c3cfd1cf7d49c6ee5317 (diff) | |
download | cpython-180ee43bde99b8ce4c4f1d5237ab191e26118061.zip cpython-180ee43bde99b8ce4c4f1d5237ab191e26118061.tar.gz cpython-180ee43bde99b8ce4c4f1d5237ab191e26118061.tar.bz2 |
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.
Diffstat (limited to 'Python/sysmodule.c')
0 files changed, 0 insertions, 0 deletions