.. data:: ZIP_DEFLATED
The numeric constant for the usual ZIP compression method. This requires the
- zlib module.
- :mod:`zlib` module. No other compression methods are currently supported.
++ :mod:`zlib` module.
+
+
+.. data:: ZIP_BZIP2
+
+ The numeric constant for the BZIP2 compression method. This requires the
- bz2 module.
++ :mod:`bz2` module.
+
+ .. versionadded:: 3.3
+
+.. data:: ZIP_LZMA
+
+ The numeric constant for the LZMA compression method. This requires the
- lzma module.
++ :mod:`lzma` module.
+
+ .. versionadded:: 3.3
+
+ .. note::
+
+ The ZIP file format specification has included support for bzip2 compression
+ since 2001, and for LZMA compression since 2006. However, some tools
+ (including older Python releases) do not support these compression
+ methods, and may either refuse to process the ZIP file altogether,
+ or fail to extract individual files.
.. seealso::
.. versionadded:: 3.2
Added the ability to use :class:`ZipFile` as a context manager.
- Added support for :mod:`bzip2` and :mod:`lzma` compression.
+ .. versionchanged:: 3.3
++ Added support for :mod:`bzip2 <bz2>` and :mod:`lzma` compression.
+
.. method:: ZipFile.close()