[Python-checkins] cpython (merge 3.3 -> default): merge 3.3 (#17811)
benjamin.peterson
python-checkins at python.org
Sun Jan 19 04:57:57 CET 2014
http://hg.python.org/cpython/rev/4d56006133f1
changeset: 88568:4d56006133f1
parent: 88566:cf0678c3b735
parent: 88567:8b413f813a13
user: Benjamin Peterson <benjamin at python.org>
date: Sat Jan 18 22:57:05 2014 -0500
summary:
merge 3.3 (#17811)
files:
Doc/library/os.rst | 16 ++++++++++------
Modules/posixmodule.c | 16 ++++++++++------
2 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -1103,9 +1103,12 @@
.. function:: readv(fd, buffers)
- Read from a file descriptor into a number of writable buffers. *buffers* is
- an arbitrary sequence of writable buffers. Returns the total number of bytes
- read.
+ Read from a file descriptor *fd* into a number of mutable :term:`bytes-like
+ objects <bytes-like object>` *buffers*. :func:`~os.readv` will transfer data
+ into each buffer until it is full and then move on to the next buffer in the
+ sequence to hold the rest of the data. :func:`~os.readv` returns the total
+ number of bytes read (which may be less than the total capacity of all the
+ objects).
Availability: Unix.
@@ -1155,9 +1158,10 @@
.. function:: writev(fd, buffers)
- Write the contents of *buffers* to file descriptor *fd*, where *buffers*
- is an arbitrary sequence of buffers.
- Returns the total number of bytes written.
+ Write the contents of *buffers* to file descriptor *fd*. *buffers* must be a
+ sequence of :term:`bytes-like objects <bytes-like object>`.
+ :func:`~os.writev` writes the contents of each object to the file descriptor
+ and returns the total number of bytes written.
Availability: Unix.
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -8061,9 +8061,12 @@
#ifdef HAVE_READV
PyDoc_STRVAR(posix_readv__doc__,
"readv(fd, buffers) -> bytesread\n\n\
-Read from a file descriptor into a number of writable buffers. buffers\n\
-is an arbitrary sequence of writable buffers.\n\
-Returns the total number of bytes read.");
+Read from a file descriptor fd into a number of mutable, bytes-like\n\
+objects (\"buffers\"). readv will transfer data into each buffer\n\
+until it is full and then move on to the next buffer in the sequence\n\
+to hold the rest of the data.\n\n\
+readv returns the total number of bytes read (which may be less than\n\
+the total capacity of all the buffers.");
static PyObject *
posix_readv(PyObject *self, PyObject *args)
@@ -8457,9 +8460,10 @@
#ifdef HAVE_WRITEV
PyDoc_STRVAR(posix_writev__doc__,
"writev(fd, buffers) -> byteswritten\n\n\
-Write the contents of buffers to a file descriptor, where buffers is an\n\
-arbitrary sequence of buffers.\n\
-Returns the total bytes written.");
+Write the contents of *buffers* to file descriptor *fd*. *buffers*\n\
+must be a sequence of bytes-like objects.\n\n\
+writev writes the contents of each object to the file descriptor\n\
+and returns the total number of bytes written.");
static PyObject *
posix_writev(PyObject *self, PyObject *args)
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list