Skip to content

Commit 47c36b7

Browse files
committed
gh-157265: Adjust test for Windows (GH-157334)
gh-157266: Adjust test for Windows On Windows (no symlinks, no hardlinks), the behaviour is the same as without the fix in GH-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)
1 parent 0cc0073 commit 47c36b7

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/test/test_tarfile.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4071,15 +4071,15 @@ def test_sneaky_hardlink_fallback(self):
40714071
for filter in 'tar', 'fully_trusted':
40724072
with self.subTest(filter), self.check_context(arc.open(), filter):
40734073
if not os_helper.can_symlink():
4074-
if filter == 'tar':
4074+
if filter == 'fully_trusted' or sys.platform == "win32":
4075+
self.expect_file("a/t/dummy")
4076+
self.expect_file("b/")
4077+
self.expect_file("c/")
4078+
else:
40754079
self.expect_exception(
40764080
tarfile.LinkFallbackError,
40774081
"link 'boom' would be extracted as a copy of "
40784082
+ "'c/escape', which was rejected")
4079-
else:
4080-
self.expect_file("a/t/dummy")
4081-
self.expect_file("b/")
4082-
self.expect_file("c/")
40834083
else:
40844084
self.expect_file("a/t/dummy")
40854085
self.expect_file("b/")

0 commit comments

Comments
 (0)