summaryrefslogtreecommitdiff
path: root/Doc/library/lzma.rst
diff options
context:
space:
mode:
authorMariatta Wijaya <mariatta.wijaya@gmail.com>2017-02-06 20:16:58 -0800
committerMariatta Wijaya <mariatta.wijaya@gmail.com>2017-02-06 20:16:58 -0800
commitda79bcf8ac7ae72218ab023e1ed54390bc1a3a27 (patch)
tree74845e2dbd9521d9748b9c32f1922f4123083bf3 /Doc/library/lzma.rst
parente3c7e835bdfc97750eb9b7fc0ad2493108c2d438 (diff)
parent1fe806ac56f8b83694d24ab604eb695d00bc8497 (diff)
downloadcpython-da79bcf8ac7ae72218ab023e1ed54390bc1a3a27.tar.gz
Issue #29371: merge with 3.5
Diffstat (limited to 'Doc/library/lzma.rst')
-rw-r--r--Doc/library/lzma.rst18
1 files changed, 13 insertions, 5 deletions
diff --git a/Doc/library/lzma.rst b/Doc/library/lzma.rst
index 61b3ba3bb6..5edb23de83 100644
--- a/Doc/library/lzma.rst
+++ b/Doc/library/lzma.rst
@@ -39,8 +39,9 @@ Reading and writing compressed files
object`.
The *filename* argument can be either an actual file name (given as a
- :class:`str` or :class:`bytes` object), in which case the named file is
- opened, or it can be an existing file object to read from or write to.
+ :class:`str`, :class:`bytes` or :term:`path-like object` object), in
+ which case the named file is opened, or it can be an existing file object
+ to read from or write to.
The *mode* argument can be any of ``"r"``, ``"rb"``, ``"w"``, ``"wb"``,
``"x"``, ``"xb"``, ``"a"`` or ``"ab"`` for binary mode, or ``"rt"``,
@@ -64,6 +65,9 @@ Reading and writing compressed files
.. versionchanged:: 3.4
Added support for the ``"x"``, ``"xb"`` and ``"xt"`` modes.
+ .. versionchanged:: 3.6
+ Accepts a :term:`path-like object`.
+
.. class:: LZMAFile(filename=None, mode="r", \*, format=None, check=-1, preset=None, filters=None)
@@ -71,9 +75,10 @@ Reading and writing compressed files
An :class:`LZMAFile` can wrap an already-open :term:`file object`, or operate
directly on a named file. The *filename* argument specifies either the file
- object to wrap, or the name of the file to open (as a :class:`str` or
- :class:`bytes` object). When wrapping an existing file object, the wrapped
- file will not be closed when the :class:`LZMAFile` is closed.
+ object to wrap, or the name of the file to open (as a :class:`str`,
+ :class:`bytes` or :term:`path-like object` object). When wrapping an
+ existing file object, the wrapped file will not be closed when the
+ :class:`LZMAFile` is closed.
The *mode* argument can be either ``"r"`` for reading (default), ``"w"`` for
overwriting, ``"x"`` for exclusive creation, or ``"a"`` for appending. These
@@ -118,6 +123,9 @@ Reading and writing compressed files
The :meth:`~io.BufferedIOBase.read` method now accepts an argument of
``None``.
+ .. versionchanged:: 3.6
+ Accepts a :term:`path-like object`.
+
Compressing and decompressing data in memory
--------------------------------------------