Skip to content

Commit f93473e

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 05f187c commit f93473e

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
@@ -4418,15 +4418,15 @@ def test_sneaky_hardlink_fallback(self):
44184418
for filter in 'tar', 'fully_trusted':
44194419
with self.subTest(filter), self.check_context(arc.open(), filter):
44204420
if not os_helper.can_symlink():
4421-
if filter == 'tar':
4421+
if filter == 'fully_trusted' or sys.platform == "win32":
4422+
self.expect_file("a/t/dummy")
4423+
self.expect_file("b/")
4424+
self.expect_file("c/")
4425+
else:
44224426
self.expect_exception(
44234427
tarfile.LinkFallbackError,
44244428
"link 'boom' would be extracted as a copy of "
44254429
+ "'c/escape', which was rejected")
4426-
else:
4427-
self.expect_file("a/t/dummy")
4428-
self.expect_file("b/")
4429-
self.expect_file("c/")
44304430
else:
44314431
self.expect_file("a/t/dummy")
44324432
self.expect_file("b/")

0 commit comments

Comments
 (0)