Skip to content

Commit 6d4d4d6

Browse files
committed
Fix test_tarfile (for not exporting LinkFallbackError) and remove the
non-strict test for unreadable symlinks, whch isn't supported before 3.13.
1 parent 8ab383f commit 6d4d4d6

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

Lib/test/test_posixpath.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -739,22 +739,6 @@ def test_realpath_resolve_first(self, kwargs):
739739
safe_rmdir(ABSTFN + "/k")
740740
safe_rmdir(ABSTFN)
741741

742-
@os_helper.skip_unless_symlink
743-
@skip_if_ABSTFN_contains_backslash
744-
@unittest.skipIf(os.chmod not in os.supports_follow_symlinks, "Can't set symlink permissions")
745-
@unittest.skipIf(sys.platform != "darwin", "only macOS requires read permission to readlink()")
746-
def test_realpath_unreadable_symlink(self):
747-
try:
748-
os.symlink(ABSTFN+"1", ABSTFN)
749-
os.chmod(ABSTFN, 0o000, follow_symlinks=False)
750-
self.assertEqual(realpath(ABSTFN), ABSTFN)
751-
self.assertEqual(realpath(ABSTFN + '/foo'), ABSTFN + '/foo')
752-
self.assertEqual(realpath(ABSTFN + '/../foo'), dirname(ABSTFN) + '/foo')
753-
self.assertEqual(realpath(ABSTFN + '/foo/..'), ABSTFN)
754-
finally:
755-
os.chmod(ABSTFN, 0o755, follow_symlinks=False)
756-
os_helper.unlink(ABSTFN)
757-
758742
@os_helper.skip_unless_symlink
759743
@skip_if_ABSTFN_contains_backslash
760744
@unittest.skipIf(os.chmod not in os.supports_follow_symlinks, "Can't set symlink permissions")

Lib/test/test_tarfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2533,7 +2533,7 @@ def test__all__(self):
25332533
"fully_trusted_filter", "data_filter",
25342534
"tar_filter", "FilterError", "AbsoluteLinkError",
25352535
"OutsideDestinationError", "SpecialFileError", "AbsolutePathError",
2536-
"LinkOutsideDestinationError",
2536+
"LinkOutsideDestinationError", "LinkFallbackError",
25372537
}
25382538
support.check__all__(self, tarfile, not_exported=not_exported)
25392539

0 commit comments

Comments
 (0)