diff options
author | slateny <46876382+slateny@users.noreply.github.com> | 2022-04-20 08:24:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-20 08:24:53 (GMT) |
commit | 5101d97d0b13425ccc5ed37abfabb07701db81fe (patch) | |
tree | dc7e017fabb2b9ffb313b26bfaf2741045bf5b2c /Doc | |
parent | 26f2e688b84b4c41c3b94b81b747f5776d19a52e (diff) | |
download | cpython-5101d97d0b13425ccc5ed37abfabb07701db81fe.zip cpython-5101d97d0b13425ccc5ed37abfabb07701db81fe.tar.gz cpython-5101d97d0b13425ccc5ed37abfabb07701db81fe.tar.bz2 |
bpo-30718: Add information about text buffering (GH-32351)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/functions.rst | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index eaa4d48..e6fd0bb 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1165,7 +1165,11 @@ are always available. They are listed here in alphabetical order. *buffering* is an optional integer used to set the buffering policy. Pass 0 to switch buffering off (only allowed in binary mode), 1 to select line buffering (only usable in text mode), and an integer > 1 to indicate the size - in bytes of a fixed-size chunk buffer. When no *buffering* argument is + in bytes of a fixed-size chunk buffer. Note that specifying a buffer size this + way applies for binary buffered I/O, but ``TextIOWrapper`` (i.e., files opened + with ``mode='r+'``) would have another buffering. To disable buffering in + ``TextIOWrapper``, consider using the ``write_through`` flag for + :func:`io.TextIOWrapper.reconfigure`. When no *buffering* argument is given, the default buffering policy works as follows: * Binary files are buffered in fixed-size chunks; the size of the buffer is |