mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
GH-117546: Fix symlink resolution in os.path.realpath('loop/../link')
(#117568)
Continue resolving symlink targets after encountering a symlink loop, which matches coreutils `realpath` behaviour.
This commit is contained in:
parent
6bc0b33a91
commit
630df37116
4 changed files with 7 additions and 17 deletions
|
@ -484,7 +484,7 @@ class PosixPathTest(unittest.TestCase):
|
|||
self.assertEqual(realpath(ABSTFN+"1/../x"), dirname(ABSTFN) + "/x")
|
||||
os.symlink(ABSTFN+"x", ABSTFN+"y")
|
||||
self.assertEqual(realpath(ABSTFN+"1/../" + basename(ABSTFN) + "y"),
|
||||
ABSTFN + "y")
|
||||
ABSTFN + "x")
|
||||
self.assertEqual(realpath(ABSTFN+"1/../" + basename(ABSTFN) + "1"),
|
||||
ABSTFN + "1")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue