Skip to content

Commit b4c75c0

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 830cbcb commit b4c75c0

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
@@ -4451,15 +4451,15 @@ def test_sneaky_hardlink_fallback(self):
44514451
for filter in 'tar', 'fully_trusted':
44524452
with self.subTest(filter), self.check_context(arc.open(), filter):
44534453
if not os_helper.can_symlink():
4454-
if filter == 'tar':
4454+
if filter == 'fully_trusted' or sys.platform == "win32":
4455+
self.expect_file("a/t/dummy")
4456+
self.expect_file("b/")
4457+
self.expect_file("c/")
4458+
else:
44554459
self.expect_exception(
44564460
tarfile.LinkFallbackError,
44574461
"link 'boom' would be extracted as a copy of "
44584462
+ "'c/escape', which was rejected")
4459-
else:
4460-
self.expect_file("a/t/dummy")
4461-
self.expect_file("b/")
4462-
self.expect_file("c/")
44634463
else:
44644464
self.expect_file("a/t/dummy")
44654465
self.expect_file("b/")

0 commit comments

Comments
 (0)