8000 gh-102950: Implement PEP 706 – Filter for tarfile.extractall by encukou · Pull Request #102953 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-102950: Implement PEP 706 – Filter for tarfile.extractall #102953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix typos in docs & comments
Thanks to Ethan for spotting these
  • Loading branch information
encukou committed Mar 27, 2023
commit 54b56446f97c8aaf90b66ef4cb7a9d095f751fe2
6 changes: 3 additions & 3 deletions Doc/library/tarfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Some facts and figures:

.. versionchanged:: 3.12
Archives are extracted using a :ref:`filter <tarfile-extraction-filter>`,
which makes easy to either limit surprising/dangerous features,
which makes it easy to either limit surprising/dangerous features,
or to acknowledge that they are expected and the archive is fully trusted.
By default, archives are fully trusted, but this default is deprecated
and slated to change in Python 3.14.
Expand Down Expand Up @@ -985,8 +985,8 @@ Here is an incomplete list of things to consider:
etc.).
* Check that filenames have expected extensions (discouraging files that
execute when you “click on them”, or extension-less files like Windows special device names),
* Limiting the number of extracted files, total size of extracted data,
filename length (including symlink length), size of individual files.
* Limit the number of extracted files, total size of extracted data,
filename length (including symlink length), and size of individual files.
* Check for files that would be shadowed on case-insensitive filesystems.

Also note that:
Expand Down
2 changes: 1 addition & 1 deletion Lib/shutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ def unpack_archive(filename, extract_dir=None, format=None, filter=None):

In case none is found, a ValueError is raised.

If `filter` is given, it is passed to he underlying
If `filter` is given, it is passed to the underlying
extraction function.
"""
sys.audit("shutil.unpack_archive", filename, extract_dir, format)
Expand Down
0