Merged revisions 78884 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r78884 | ezio.melotti | 2010-03-13 00:45:38 +0200 (Sat, 13 Mar 2010) | 1 line

  #8057: fix strings -> byte strings
........
This commit is contained in:
Ezio Melotti 2010-03-12 22:48:16 +00:00
parent 416d662f30
commit ede5d83f12
1 changed files with 12 additions and 10 deletions

View File

@ -73,15 +73,16 @@ Handling of compressed files is offered by the :class:`BZ2File` class.
.. method:: read([size]) .. method:: read([size])
Read at most *size* uncompressed bytes, returned as a string. If the Read at most *size* uncompressed bytes, returned as a byte string. If the
*size* argument is negative or omitted, read until EOF is reached. *size* argument is negative or omitted, read until EOF is reached.
.. method:: readline([size]) .. method:: readline([size])
Return the next line from the file, as a string, retaining newline. A Return the next line from the file, as a byte string, retaining newline.
non-negative *size* argument limits the maximum number of bytes to return A non-negative *size* argument limits the maximum number of bytes to
(an incomplete line may be returned then). Return an empty string at EOF. return (an incomplete line may be returned then). Return an empty byte
string at EOF.
.. method:: readlines([size]) .. method:: readlines([size])
@ -111,15 +112,16 @@ Handling of compressed files is offered by the :class:`BZ2File` class.
.. method:: write(data) .. method:: write(data)
Write string *data* to file. Note that due to buffering, :meth:`close` may Write the byte string *data* to file. Note that due to buffering,
be needed before the file on disk reflects the data written. :meth:`close` may be needed before the file on disk reflects the data
written.
.. method:: writelines(sequence_of_strings) .. method:: writelines(sequence_of_byte_strings)
Write the sequence of strings to the file. Note that newlines are not Write the sequence of byte strings to the file. Note that newlines are not
added. The sequence can be any iterable object producing strings. This is added. The sequence can be any iterable object producing byte strings.
equivalent to calling write() for each string. This is equivalent to calling write() for each byte string.
Sequential (de)compression Sequential (de)compression