[Python-checkins] r80593 - in python/branches/release26-maint: Doc/library/io.rst
python-checkins at python.org
Wed Apr 28 21:59:23 CEST 2010
Date: Wed Apr 28 21:59:22 2010
New Revision: 80593
Merged revisions 80591-80592 via svnmerge from
r80591 | antoine.pitrou | 2010-04-28 21:53:35 +0200 (mer., 28 avril 2010) | 4 lines
State clearly that truncate() doesn't move the file position,
and remove a duplicate of its specification.
r80592 | antoine.pitrou | 2010-04-28 21:57:33 +0200 (mer., 28 avril 2010) | 3 lines
Clarify and fix the documentation for IOBase.close()
python/branches/release26-maint/ (props changed)
--- python/branches/release26-maint/Doc/library/io.rst (original)
+++ python/branches/release26-maint/Doc/library/io.rst Wed Apr 28 21:59:22 2010
@@ -226,8 +226,10 @@
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 @@
.. 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 @@
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])
More information about the Python-checkins