diff options
author | R David Murray <rdmurray@bitdance.com> | 2012-08-15 14:43:58 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2012-08-15 14:43:58 (GMT) |
commit | 1b00f25bf99d9b7a5f307984f6467258de636d23 (patch) | |
tree | 18d19d268ea3a642be447d3f7041211dc40f9379 /Doc/library/bz2.rst | |
parent | f748a3773fd40dd91195fc2fef2cac2f973baaf8 (diff) | |
download | cpython-1b00f25bf99d9b7a5f307984f6467258de636d23.zip cpython-1b00f25bf99d9b7a5f307984f6467258de636d23.tar.gz cpython-1b00f25bf99d9b7a5f307984f6467258de636d23.tar.bz2 |
#15543: glossary entry for and 'universal newlines', and links to it.
Patch by Chris Jerdonek.
Diffstat (limited to 'Doc/library/bz2.rst')
-rw-r--r-- | Doc/library/bz2.rst | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Doc/library/bz2.rst b/Doc/library/bz2.rst index d13f6e0..93144b6 100644 --- a/Doc/library/bz2.rst +++ b/Doc/library/bz2.rst @@ -40,6 +40,9 @@ Here is a summary of the features offered by the bz2 module: Handling of compressed files is offered by the :class:`BZ2File` class. +.. index:: + single: universal newlines; bz2.BZ2File class + .. class:: BZ2File(filename, mode='r', buffering=0, compresslevel=9) Open a bz2 file. Mode can be either ``'r'`` or ``'w'``, for reading (default) @@ -48,7 +51,7 @@ Handling of compressed files is offered by the :class:`BZ2File` class. unbuffered, and larger numbers specify the buffer size; the default is ``0``. If *compresslevel* is given, it must be a number between ``1`` and ``9``; the default is ``9``. Add a ``'U'`` to mode to open the file for input - with universal newline support. Any line ending in the input file will be + in :term:`universal newlines` mode. Any line ending in the input file will be seen as a ``'\n'`` in Python. Also, a file so opened gains the attribute :attr:`newlines`; the value for this attribute is one of ``None`` (no newline read yet), ``'\r'``, ``'\n'``, ``'\r\n'`` or a tuple containing all the |