Skip to content

Commit 52a83fa

Browse files
committed
Tweak Whats New and NEWS, assert buf->length
1 parent 25125f2 commit 52a83fa

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

Doc/whatsnew/3.14.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ os
562562
(Contributed by James Roy in :gh:`127688`.)
563563

564564
* Add the :func:`os.readinto` function to read into a
565-
:ref:`buffer protocol <bufferobjects>` from a file descriptor.
565+
:ref:`buffer object <bufferobjects>` from a file descriptor.
566566
(Contributed by Cody Maloney in :gh:`129205`.)
567567

568568
pathlib
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Add :func:`os.readinto` to read into a :ref:`buffer protocol <bufferobjects>` from a file descriptor.
1+
Add :func:`os.readinto` to read into a :ref:`buffer object <bufferobjects>` from a file descriptor.

Modules/posixmodule.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11456,12 +11456,7 @@ static Py_ssize_t
1145611456
os_readinto_impl(PyObject *module, int fd, Py_buffer *buffer)
1145711457
/*[clinic end generated code: output=8091a3513c683a80 input=7485bbbb143bf7e8]*/
1145811458
{
11459-
if (buffer->len < 0) {
11460-
assert(!PyErr_Occurred());
11461-
errno = EINVAL;
11462-
PyErr_SetFromErrno(PyExc_OSError);
11463-
return -1;
11464-
}
11459+
assert(buffer->len >= 0);
1146511460
Py_ssize_t result = _Py_read(fd, buffer->buf, buffer->len);
1146611461
/* Ensure negative is never returned without an error. Simplifies calling
1146711462
code. _Py_read should succeed, possibly reading 0 bytes, _or_ set an

0 commit comments

Comments
 (0)