Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Doc/library/bz2.rst

    r2 r391  
    1515types for sequential (de)compression.
    1616
    17 For other archive formats, see the :mod:`gzip`, :mod:`zipfile`, and
    18 :mod:`tarfile` modules.
    19 
    2017Here is a summary of the features offered by the bz2 module:
    2118
    2219* :class:`BZ2File` class implements a complete file interface, including
    23   :meth:`readline`, :meth:`readlines`, :meth:`writelines`, :meth:`seek`, etc;
    24 
    25 * :class:`BZ2File` class implements emulated :meth:`seek` support;
     20  :meth:`~BZ2File.readline`, :meth:`~BZ2File.readlines`,
     21  :meth:`~BZ2File.writelines`, :meth:`~BZ2File.seek`, etc;
     22
     23* :class:`BZ2File` class implements emulated :meth:`~BZ2File.seek` support;
    2624
    2725* :class:`BZ2File` class implements universal newline support;
     
    4442Handling of compressed files is offered by the :class:`BZ2File` class.
    4543
     44
     45.. index::
     46   single: universal newlines; bz2.BZ2File class
    4647
    4748.. class:: BZ2File(filename[, mode[, buffering[, compresslevel]]])
     
    5354   ``0``. If *compresslevel* is given, it must be a number between ``1`` and
    5455   ``9``; the default is ``9``. Add a ``'U'`` to mode to open the file for input
    55    with universal newline support. Any line ending in the input file will be
     56   in :term:`universal newlines` mode. Any line ending in the input file will be
    5657   seen as a ``'\n'`` in Python.  Also, a file so opened gains the attribute
    5758   :attr:`newlines`; the value for this attribute is one of ``None`` (no newline
     
    6061   reading. Instances support iteration in the same way as normal :class:`file`
    6162   instances.
     63
     64   :class:`BZ2File` supports the :keyword:`with` statement.
     65
     66   .. versionchanged:: 2.7
     67      Support for the :keyword:`with` statement was added.
     68
     69
     70   .. note::
     71
     72      This class does not support input files containing multiple streams (such
     73      as those produced by the :program:`pbzip2` tool). When reading such an
     74      input file, only the first stream will be accessible. If you require
     75      support for multi-stream files, consider using the third-party
     76      :mod:`bz2file` module (available from
     77      `PyPI <http://pypi.python.org/pypi/bz2file>`_). This module provides a
     78      backport of Python 3.3's :class:`BZ2File` class, which does support
     79      multi-stream files.
    6280
    6381
Note: See TracChangeset for help on using the changeset viewer.