mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
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.
This commit is contained in:
parent
fc36e66af4
commit
6bb91f3b6e
10 changed files with 128 additions and 67 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue