summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/library/io.rst15
1 files changed, 7 insertions, 8 deletions
diff --git a/Doc/library/io.rst b/Doc/library/io.rst
index a8a4068..1a4b959 100644
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -226,8 +226,10 @@ I/O Base Classes
Flush and close this stream. This method has no effect if the file is
already closed. Once the file is closed, any operation on the file
- (e.g. reading or writing) will raise an :exc:`IOError`. The internal
- file descriptor isn't closed if *closefd* was False.
+ (e.g. reading or writing) will raise an :exc:`ValueError`.
+
+ As a convenience, it is allowed to call this method more than once;
+ only the first call, however, will have an effect.
.. attribute:: closed
@@ -293,7 +295,9 @@ I/O Base Classes
.. method:: truncate([size])
Truncate the file to at most *size* bytes. *size* defaults to the current
- file position, as returned by :meth:`tell`.
+ file position, as returned by :meth:`tell`. Note that the current file
+ position isn't changed; if you want to change it to the new end of
+ file, you have to :meth:`seek()` explicitly.
.. method:: writable()
@@ -467,11 +471,6 @@ Buffered Streams
In :class:`BytesIO`, this is the same as :meth:`read`.
- .. method:: truncate([size])
-
- Truncate the buffer to at most *size* bytes. *size* defaults to the
- current stream position, as returned by :meth:`tell`.
-
.. class:: BufferedReader(raw[, buffer_size])