From: Christoph Walcher Date: Mon, 8 Sep 2025 13:42:54 +0000 (+0200) Subject: gh-57911: Fix failing symlink test in tarfile (GH-138626) X-Git-Tag: v3.15.0a1~450 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=59edf12705ca574040af266e044c7af69b5a75dd;p=thirdparty%2FPython%2Fcpython.git gh-57911: Fix failing symlink test in tarfile (GH-138626) --- 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/..')