summaryrefslogtreecommitdiffstats
path: root/Modules/_io/fileio.c
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-05-28 00:41:57 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-05-28 00:41:57 (GMT)
commit6bb91f3b6e51352f91bcf785d3f6fe160ed2cd85 (patch)
tree0f97c3f8b3fac65680e880ec870796138af78faf /Modules/_io/fileio.c
parentfc36e66af46957a65b12ab0087027727f8555aed (diff)
downloadcpython-6bb91f3b6e51352f91bcf785d3f6fe160ed2cd85.zip
cpython-6bb91f3b6e51352f91bcf785d3f6fe160ed2cd85.tar.gz
cpython-6bb91f3b6e51352f91bcf785d3f6fe160ed2cd85.tar.bz2
Issue #20699: Document that “io” methods accept bytes-like objects
This matches the usage of ZipFile and BufferedWriter. This still requires return values to be bytes() objects. Also document and test that the write() methods should only access their argument before they return.
Diffstat (limited to 'Modules/_io/fileio.c')
-rw-r--r--Modules/_io/fileio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
index dbd604a..83b6a32 100644
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -836,7 +836,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,
@@ -845,7 +845,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;