]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-57911: Fix failing symlink test in tarfile (GH-138626)
authorChristoph Walcher <christoph-wa@gmx.de>
Mon, 8 Sep 2025 13:42:54 +0000 (15:42 +0200)
committerGitHub <noreply@github.com>
Mon, 8 Sep 2025 13:42:54 +0000 (15:42 +0200)
Lib/test/test_tarfile.py

index e5466c3bf2a5e84131e960ba84f1ae374a373b61..9892005787c8a6aff22b65de5bca9ce342bb31e1 100644 (file)
@@ -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/..')