Skip to content

[3.10] gh-157265: tarfile: Honor None result of filter for link fallbacks (GH-157266) - #157304

Merged
pablogsal merged 3 commits into
python:3.10from
miss-islington:backport-fb2f0bb-3.10
Oct 1, 2026
Merged

pablogsal merged 3 commits into
python:3.10from
miss-islington:backport-fb2f0bb-3.10

Conversation

@miss-islington

@miss-islington miss-islington commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

(cherry picked from commit fb2f0bb)

Co-authored-by: Petr Viktorin encukou@gmail.com
Co-authored-by: Stan Ulbrych stan@python.org

…cks (pythonGH-157266)

(cherry picked from commit fb2f0bb)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
pythongh-157266: Adjust test for Windows

On Windows (no symlinks, no hardlinks), the behaviour is
the same as without the fix in pythonGH-157266:
- a/t/dummy is extracted
- b/ is extracted
- c/ is *not* created (the target, a/t, is not in the archive)
- c/escape: c/ is created; escape is skipped (target,
   c/../../link_here, is not in archive)
- c is not recreated as a directory
- boom is not created (target is c/escape, which falls back to
  ..\..\link_here, which does not exist in archive)
@encukou
encukou marked this pull request as ready for review September 15, 2026 12:44
@pablogsal
pablogsal merged commit c1f106d into python:3.10 Oct 1, 2026
14 of 15 checks passed
@miss-islington
miss-islington deleted the backport-fb2f0bb-3.10 branch October 1, 2026 00:29
icanhasmath pushed a commit to ActiveState/cpython that referenced this pull request Oct 28, 2026
… fallbacks (pythonGH-157266) (python#157304)

* pythongh-157265: tarfile: Honor None result of filter for link fallbacks (pythonGH-157266)

(cherry picked from commit fb2f0bb)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>

* pythongh-157265: Adjust test for Windows (pythonGH-157334)

pythongh-157266: Adjust test for Windows

On Windows (no symlinks, no hardlinks), the behaviour is
the same as without the fix in pythonGH-157266:
- a/t/dummy is extracted
- b/ is extracted
- c/ is *not* created (the target, a/t, is not in the archive)
- c/escape: c/ is created; escape is skipped (target,
   c/../../link_here, is not in archive)
- c is not recreated as a directory
- boom is not created (target is c/escape, which falls back to
  ..\..\link_here, which does not exist in archive)

* Remove @symlink_test (which is there for WASI in 3.11+)

---------

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
(cherry picked from commit c1f106d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants