mirror of
https://github.com/python/cpython.git
synced 2025-08-15 14:20:55 +00:00
bpo-9949: Enable symlink traversal for ntpath.realpath (GH-15287)
(cherry picked from commit 75e064962e
)
Co-authored-by: Steve Dower <steve.dower@python.org>
This commit is contained in:
parent
7e293f5e4c
commit
c30c869e8d
8 changed files with 304 additions and 32 deletions
|
@ -1871,11 +1871,7 @@ class TestMove(unittest.TestCase):
|
|||
dst_link = os.path.join(self.dst_dir, 'quux')
|
||||
shutil.move(dst, dst_link)
|
||||
self.assertTrue(os.path.islink(dst_link))
|
||||
# On Windows, os.path.realpath does not follow symlinks (issue #9949)
|
||||
if os.name == 'nt':
|
||||
self.assertEqual(os.path.realpath(src), os.readlink(dst_link))
|
||||
else:
|
||||
self.assertEqual(os.path.realpath(src), os.path.realpath(dst_link))
|
||||
self.assertEqual(os.path.realpath(src), os.path.realpath(dst_link))
|
||||
|
||||
@support.skip_unless_symlink
|
||||
@mock_rename
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue