summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew
diff options
context:
space:
mode:
authorPetr Viktorin <encukou@gmail.com>2023-04-24 08:58:06 (GMT)
committerGitHub <noreply@github.com>2023-04-24 08:58:06 (GMT)
commitaf530469954e8ad49f1e071ef31c844b9bfda414 (patch)
treeb25ee06655322d64286f8eb9736295f12d8635e7 /Doc/whatsnew
parent36860134a9eda8df5af5a38d6c7533437c594c2f (diff)
downloadcpython-af530469954e8ad49f1e071ef31c844b9bfda414.zip
cpython-af530469954e8ad49f1e071ef31c844b9bfda414.tar.gz
cpython-af530469954e8ad49f1e071ef31c844b9bfda414.tar.bz2
gh-102950: Implement PEP 706 – Filter for tarfile.extractall (#102953)
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r--Doc/whatsnew/3.12.rst15
1 files changed, 15 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.12.rst b/Doc/whatsnew/3.12.rst
index d16c496..373e31b 100644
--- a/Doc/whatsnew/3.12.rst
+++ b/Doc/whatsnew/3.12.rst
@@ -137,6 +137,13 @@ New Features
(Design by Pablo Galindo. Contributed by Pablo Galindo and Christian Heimes
with contributions from Gregory P. Smith [Google] and Mark Shannon
in :gh:`96123`.)
+* The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`,
+ have a new a *filter* argument that allows limiting tar features than may be
+ surprising or dangerous, such as creating files outside the destination
+ directory.
+ See :ref:`tarfile-extraction-filter` for details.
+ In Python 3.14, the default will switch to ``'data'``.
+ (Contributed by Petr Viktorin in :pep:`706`.)
Other Language Changes
@@ -630,6 +637,10 @@ Deprecated
* The *onerror* argument of :func:`shutil.rmtree` is deprecated as will be removed
in Python 3.14. Use *onexc* instead. (Contributed by Irit Katriel in :gh:`102828`.)
+* Extracting tar archives without specifying *filter* is deprecated until
+ Python 3.14, when ``'data'`` filter will become the default.
+ See :ref:`tarfile-extraction-filter` for details.
+
Pending Removal in Python 3.13
------------------------------
@@ -992,6 +1003,10 @@ Changes in the Python API
exception instance, rather than to a ``(typ, exc, tb)`` tuple.
(Contributed by Irit Katriel in :gh:`103176`.)
+* When extracting tar files using :mod:`tarfile` or
+ :func:`shutil.unpack_archive`, pass the *filter* argument to limit features
+ that may be surprising or dangerous.
+ See :ref:`tarfile-extraction-filter` for details.
Build Changes
=============