From 59edf12705ca574040af266e044c7af69b5a75dd Mon Sep 17 00:00:00 2001 From: Christoph Walcher Date: Mon, 8 Sep 2025 15:42:54 +0200 Subject: [PATCH] gh-57911: Fix failing symlink test in tarfile (GH-138626) --- Lib/test/test_tarfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py index e5466c3bf2a5..9892005787c8 100644 --- a/Lib/test/test_tarfile.py +++ b/Lib/test/test_tarfile.py @@ -3694,7 +3694,7 @@ class TestExtractionFilters(unittest.TestCase): else: raise AssertionError('Could not determine link resolution') else: - cls.dotdot_resolves_early = True + cls.dotdot_resolves_early = False @contextmanager def check_context(self, tar, filter, *, check_flag=True): @@ -3842,7 +3842,7 @@ class TestExtractionFilters(unittest.TestCase): arc.add('current', symlink_to='.') # effectively points to ./../ - if self.dotdot_resolves_early: + if self.dotdot_resolves_early and os_helper.can_symlink(): arc.add('parent', symlink_to='current/../..') else: arc.add('parent', symlink_to='current/..') -- 2.47.3