Changeset 391 for python/trunk/Doc/library/bz2.rst
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Doc/library/bz2.rst
r2 r391 15 15 types for sequential (de)compression. 16 16 17 For other archive formats, see the :mod:`gzip`, :mod:`zipfile`, and18 :mod:`tarfile` modules.19 20 17 Here is a summary of the features offered by the bz2 module: 21 18 22 19 * :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; 26 24 27 25 * :class:`BZ2File` class implements universal newline support; … … 44 42 Handling of compressed files is offered by the :class:`BZ2File` class. 45 43 44 45 .. index:: 46 single: universal newlines; bz2.BZ2File class 46 47 47 48 .. class:: BZ2File(filename[, mode[, buffering[, compresslevel]]]) … … 53 54 ``0``. If *compresslevel* is given, it must be a number between ``1`` and 54 55 ``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 be56 in :term:`universal newlines` mode. Any line ending in the input file will be 56 57 seen as a ``'\n'`` in Python. Also, a file so opened gains the attribute 57 58 :attr:`newlines`; the value for this attribute is one of ``None`` (no newline … … 60 61 reading. Instances support iteration in the same way as normal :class:`file` 61 62 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. 62 80 63 81
Note:
See TracChangeset
for help on using the changeset viewer.