mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Fix #9333. The symlink function is always available now, raising OSError
when the user doesn't hold the symbolic link privilege rather than hiding it.
This commit is contained in:
parent
baab9d0bf6
commit
3b4499c5c7
11 changed files with 55 additions and 46 deletions
|
@ -291,8 +291,7 @@ class TestShutil(unittest.TestCase):
|
|||
finally:
|
||||
shutil.rmtree(TESTFN, ignore_errors=True)
|
||||
|
||||
@unittest.skipUnless(hasattr(os, "symlink"),
|
||||
"Missing symlink implementation")
|
||||
@support.skip_unless_symlink
|
||||
def test_dont_copy_file_onto_symlink_to_itself(self):
|
||||
# bug 851123.
|
||||
os.mkdir(TESTFN)
|
||||
|
@ -312,8 +311,7 @@ class TestShutil(unittest.TestCase):
|
|||
finally:
|
||||
shutil.rmtree(TESTFN, ignore_errors=True)
|
||||
|
||||
@unittest.skipUnless(hasattr(os, "symlink"),
|
||||
"Missing symlink implementation")
|
||||
@support.skip_unless_symlink
|
||||
def test_rmtree_on_symlink(self):
|
||||
# bug 1669.
|
||||
os.mkdir(TESTFN)
|
||||
|
@ -338,8 +336,7 @@ class TestShutil(unittest.TestCase):
|
|||
finally:
|
||||
os.remove(TESTFN)
|
||||
|
||||
@unittest.skipUnless(hasattr(os, "symlink"),
|
||||
"Missing symlink implementation")
|
||||
@support.skip_unless_symlink
|
||||
def test_copytree_named_pipe(self):
|
||||
os.mkdir(TESTFN)
|
||||
try:
|
||||
|
@ -375,8 +372,7 @@ class TestShutil(unittest.TestCase):
|
|||
shutil.copytree(src_dir, dst_dir, copy_function=_copy)
|
||||
self.assertEqual(len(copied), 2)
|
||||
|
||||
@unittest.skipUnless(hasattr(os, "symlink"),
|
||||
"Missing symlink implementation")
|
||||
@support.skip_unless_symlink
|
||||
def test_copytree_dangling_symlinks(self):
|
||||
|
||||
# a dangling symlink raises an error at the end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue