summaryrefslogtreecommitdiff
path: root/Doc
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-01-13 13:25:24 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2017-01-13 13:25:24 +0200
commitc3e70c9df5ac47a4e611afdc6a4ea1e621d2d0aa (patch)
tree1175d5e2630c9dd33965445ff6aa3df1d322a2e6 /Doc
parentb85c5ca381be8c11d5217cf20d46ce45dc4164cf (diff)
downloadcpython-c3e70c9df5ac47a4e611afdc6a4ea1e621d2d0aa.tar.gz
Issue #29210: Removed support of deprecated argument "exclude" in
tarfile.TarFile.add().
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/tarfile.rst11
-rw-r--r--Doc/whatsnew/3.7.rst3
2 files changed, 5 insertions, 9 deletions
diff --git a/Doc/library/tarfile.rst b/Doc/library/tarfile.rst
index d8f809753d..2167f32f6a 100644
--- a/Doc/library/tarfile.rst
+++ b/Doc/library/tarfile.rst
@@ -429,16 +429,13 @@ be finalized; only the internally used file object will be closed. See the
Return an :class:`io.BufferedReader` object.
-.. method:: TarFile.add(name, arcname=None, recursive=True, exclude=None, *, filter=None)
+.. method:: TarFile.add(name, arcname=None, recursive=True, *, filter=None)
Add the file *name* to the archive. *name* may be any type of file
(directory, fifo, symbolic link, etc.). If given, *arcname* specifies an
alternative name for the file in the archive. Directories are added
recursively by default. This can be avoided by setting *recursive* to
- :const:`False`. If *exclude* is given, it must be a function that takes one
- filename argument and returns a boolean value. Depending on this value the
- respective file is either excluded (:const:`True`) or added
- (:const:`False`). If *filter* is specified it must be a keyword argument. It
+ :const:`False`. If *filter* is given, it
should be a function that takes a :class:`TarInfo` object argument and
returns the changed :class:`TarInfo` object. If it instead returns
:const:`None` the :class:`TarInfo` object will be excluded from the
@@ -447,10 +444,6 @@ be finalized; only the internally used file object will be closed. See the
.. versionchanged:: 3.2
Added the *filter* parameter.
- .. deprecated:: 3.2
- The *exclude* parameter is deprecated, please use the *filter* parameter
- instead.
-
.. method:: TarFile.addfile(tarinfo, fileobj=None)
diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst
index 411f9167e7..e6dd5a17cd 100644
--- a/Doc/whatsnew/3.7.rst
+++ b/Doc/whatsnew/3.7.rst
@@ -139,6 +139,9 @@ API and Feature Removals
* Unknown escapes consisting of ``'\'`` and an ASCII letter in replacement
templates for :func:`re.sub` will now cause an error.
+* Removed support of the *exclude* argument in :meth:`tarfile.TarFile.add`.
+ Use the *filter* argument instead.
+
Porting to Python 3.7
=====================