diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-04-28 20:03:21 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-04-28 20:03:21 (GMT) |
commit | bf5391263505252eabf55b9aad8347c7a6c29fa0 (patch) | |
tree | 639bf676886c024c6728d94d44aa9b64afc9710d | |
parent | a386d0e0d73031c927893ec2e83ec10697ac5ff3 (diff) | |
download | cpython-bf5391263505252eabf55b9aad8347c7a6c29fa0.zip cpython-bf5391263505252eabf55b9aad8347c7a6c29fa0.tar.gz cpython-bf5391263505252eabf55b9aad8347c7a6c29fa0.tar.bz2 |
Merged revisions 80594 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r80594 | antoine.pitrou | 2010-04-28 21:59:32 +0200 (mer., 28 avril 2010) | 14 lines
Merged revisions 80591-80592 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
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()
........
................
-rw-r--r-- | Doc/library/io.rst | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Doc/library/io.rst b/Doc/library/io.rst index 90573bd..e9cae7c 100644 --- a/Doc/library/io.rst +++ b/Doc/library/io.rst @@ -235,8 +235,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 @@ -308,7 +310,9 @@ I/O Base Classes .. method:: truncate(size=None) 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() @@ -517,11 +521,6 @@ In many situations, buffered I/O streams will provide higher performance 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=DEFAULT_BUFFER_SIZE) |