Skip to content

Commit

Permalink
tar extract filters (#3857)
Browse files Browse the repository at this point in the history
  • Loading branch information
memsharded authored Sep 27, 2024
1 parent a9faaa9 commit 8d99beb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions reference/conanfile/methods/source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ A ``source()`` implementation might use the convenient ``get()`` helper, or use
os.unlink(zip_name)
.. important::

Please read the note in :ref:`conan_tools_files_unzip` regarding Python 3.14 breaking changes and
the new tar archive extract filters.


Applying patches to downloaded sources can be done (and should be done) in the ``source()`` method if those patches
apply to all possible configurations. As explained below, it is not possible to introduce conditionals in the
Expand Down
9 changes: 9 additions & 0 deletions reference/tools/files/basic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,15 @@ Use the ``pattern`` argument if you want to filter specific files and paths to d
unzip(self, "bigfile.zip", pattern="*.txt")
.. important::
In Conan 2.8 ``unzip()`` provides a new ``extract_filter=None`` argument and a new
``tools.files.unzip:filter`` configuration was added to prepare for future Python 3.14
breaking changes, in which the ``data`` filter for extracting tar archives will be made the default.
The recommendation is to start using the ``data`` filter as soon as possible (the conf can be
defined in ``global.conf``, or it can be explicitly added as argument in recipes ``unzip()`` and ``get()``
helpers) as that is the current security recommendation while downloading sources from the internet.
.. currentmodule:: conan.tools.files.files
Expand Down
7 changes: 7 additions & 0 deletions reference/tools/files/downloads.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ conan.tools.files.get()
.. autofunction:: get


.. important::

``get()`` calls internally ``unzip()``.
Please read the note in :ref:`conan_tools_files_unzip` regarding Python 3.14 breaking changes and
the new tar archive extract filters.


conan.tools.files.ftp_download()
--------------------------------

Expand Down

0 comments on commit 8d99beb

Please sign in to comment.