Skip to content

Commit dd5fcbc

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 69fb4b6 commit dd5fcbc

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
@@ -4186,15 +4186,15 @@ def test_sneaky_hardlink_fallback(self):
41864186
for filter in 'tar', 'fully_trusted':
41874187
with self.subTest(filter), self.check_context(arc.open(), filter):
41884188
if not os_helper.can_symlink():
4189-
if filter == 'tar':
4189+
if filter == 'fully_trusted' or sys.platform == "win32":
4190+
self.expect_file("a/t/dummy")
4191+
self.expect_file("b/")
4192+
self.expect_file("c/")
4193+
else:
41904194
self.expect_exception(
41914195
tarfile.LinkFallbackError,
41924196
"link 'boom' would be extracted as a copy of "
41934197
+ "'c/escape', which was rejected")
4194-
else:
4195-
self.expect_file("a/t/dummy")
4196-
self.expect_file("b/")
4197-
self.expect_file("c/")
41984198
else:
41994199
self.expect_file("a/t/dummy")
42004200
self.expect_file("b/")

0 commit comments

Comments
 (0)