summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-05-28 01:07:08 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-05-28 01:07:08 (GMT)
commitc249221dfda0bf05c6fab37fab9c0eb4f23c870c (patch)
treea922dedc5f1a61c5b242d08f9b00f6ba587e9452 /Modules
parent0472217d433634cb7180a37045744ad4a570d500 (diff)
parent6bb91f3b6e51352f91bcf785d3f6fe160ed2cd85 (diff)
downloadcpython-c249221dfda0bf05c6fab37fab9c0eb4f23c870c.zip
cpython-c249221dfda0bf05c6fab37fab9c0eb4f23c870c.tar.gz
cpython-c249221dfda0bf05c6fab37fab9c0eb4f23c870c.tar.bz2
Issue #20699: Merge io bytes-like fixes from 3.5
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_io/bufferedio.c4
-rw-r--r--Modules/_io/bytesio.c4
-rw-r--r--Modules/_io/clinic/bytesio.c.h4
-rw-r--r--Modules/_io/clinic/fileio.c.h4
-rw-r--r--Modules/_io/fileio.c4
-rw-r--r--Modules/_io/iobase.c5
6 files changed, 13 insertions, 12 deletions
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c
index f4d179a..cbe7425 100644
--- a/Modules/_io/bufferedio.c
+++ b/Modules/_io/bufferedio.c
@@ -190,8 +190,8 @@ bufferediobase_read1(PyObject *self, PyObject *args)
PyDoc_STRVAR(bufferediobase_write_doc,
"Write the given buffer to the IO stream.\n"
"\n"
- "Returns the number of bytes written, which is never less than\n"
- "len(b).\n"
+ "Returns the number of bytes written, which is always the length of b\n"
+ "in bytes.\n"
"\n"
"Raises BlockingIOError if the buffer is full and the\n"
"underlying raw stream cannot accept more data at the moment.\n");
diff --git a/Modules/_io/bytesio.c b/Modules/_io/bytesio.c
index ad96a90..a1ba121 100644
--- a/Modules/_io/bytesio.c
+++ b/Modules/_io/bytesio.c
@@ -546,7 +546,7 @@ _io.BytesIO.readinto
buffer: Py_buffer(accept={rwbuffer})
/
-Read up to len(buffer) bytes into buffer.
+Read bytes into buffer.
Returns number of bytes read (0 for EOF), or None if the object
is set not to block and has no data to read.
@@ -554,7 +554,7 @@ is set not to block and has no data to read.
static PyObject *
_io_BytesIO_readinto_impl(bytesio *self, Py_buffer *buffer)
-/*[clinic end generated code: output=a5d407217dcf0639 input=b52a8782706f0037]*/
+/*[clinic end generated code: output=a5d407217dcf0639 input=1424d0fdce857919]*/
{
Py_ssize_t len, n;
diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h
index e468215..5f2abb0 100644
--- a/Modules/_io/clinic/bytesio.c.h
+++ b/Modules/_io/clinic/bytesio.c.h
@@ -259,7 +259,7 @@ PyDoc_STRVAR(_io_BytesIO_readinto__doc__,
"readinto($self, buffer, /)\n"
"--\n"
"\n"
-"Read up to len(buffer) bytes into buffer.\n"
+"Read bytes into buffer.\n"
"\n"
"Returns number of bytes read (0 for EOF), or None if the object\n"
"is set not to block and has no data to read.");
@@ -419,4 +419,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs)
exit:
return return_value;
}
-/*[clinic end generated code: output=164cf0e4117dadbe input=a9049054013a1b77]*/
+/*[clinic end generated code: output=60ce2c6272718431 input=a9049054013a1b77]*/
diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h
index 4a1205e..1042008 100644
--- a/Modules/_io/clinic/fileio.c.h
+++ b/Modules/_io/clinic/fileio.c.h
@@ -222,7 +222,7 @@ PyDoc_STRVAR(_io_FileIO_write__doc__,
"write($self, b, /)\n"
"--\n"
"\n"
-"Write bytes b to file, return number written.\n"
+"Write buffer b to file, return number of bytes written.\n"
"\n"
"Only makes one system call, so not all of the data may be written.\n"
"The number of bytes actually written is returned. In non-blocking mode,\n"
@@ -364,4 +364,4 @@ _io_FileIO_isatty(fileio *self, PyObject *Py_UNUSED(ignored))
#ifndef _IO_FILEIO_TRUNCATE_METHODDEF
#define _IO_FILEIO_TRUNCATE_METHODDEF
#endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */
-/*[clinic end generated code: output=b1a20b10c81add64 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=dcbc39b466598492 input=a9049054013a1b77]*/
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index a02a9c1..fe6bc41 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -835,7 +835,7 @@ _io.FileIO.write
b: Py_buffer
/
-Write bytes b to file, return number written.
+Write buffer b to file, return number of bytes written.
Only makes one system call, so not all of the data may be written.
The number of bytes actually written is returned. In non-blocking mode,
@@ -844,7 +844,7 @@ returns None if the write would block.
static PyObject *
_io_FileIO_write_impl(fileio *self, Py_buffer *b)
-/*[clinic end generated code: output=b4059db3d363a2f7 input=ffbd8834f447ac31]*/
+/*[clinic end generated code: output=b4059db3d363a2f7 input=6e7908b36f0ce74f]*/
{
Py_ssize_t n;
int err;
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c
index 51abd32..f07a0ca 100644
--- a/Modules/_io/iobase.c
+++ b/Modules/_io/iobase.c
@@ -53,8 +53,9 @@ PyDoc_STRVAR(iobase_doc,
"called.\n"
"\n"
"The basic type used for binary data read from or written to a file is\n"
- "bytes. bytearrays are accepted too, and in some cases (such as\n"
- "readinto) needed. Text I/O classes work with str data.\n"
+ "bytes. Other bytes-like objects are accepted as method arguments too.\n"
+ "In some cases (such as readinto), a writable object is required. Text\n"
+ "I/O classes work with str data.\n"
"\n"
"Note that calling any method (except additional calls to close(),\n"
"which are ignored) on a closed stream should raise a ValueError.\n"