Message205294
Path.resolve() also fails when last link is absolute.
mkdir testdir
ln -s 0/0 testdir/1
ln -s 1/1 testdir/2
ln -s "$(readlink -f testdir)" testdir/0
Path('testdir/2').resolve() fails:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/serhiy/py/cpython/Lib/pathlib.py", line 1017, in resolve
s = self._flavour.resolve(self)
File "/home/serhiy/py/cpython/Lib/pathlib.py", line 273, in resolve
raise RuntimeError("Symlink loop from %r" % cur)
RuntimeError: Symlink loop from '/home/serhiy/py/cpython/testdir/0'
Here is a patch which implements an algorithm similar to the algorithm used in posixpath.realpath(). |
|
Date |
User |
Action |
Args |
2013-12-05 13:05:41 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, pitrou |
2013-12-05 13:05:41 | serhiy.storchaka | set | messageid: <1386248741.26.0.839977735328.issue19887@psf.upfronthosting.co.za> |
2013-12-05 13:05:41 | serhiy.storchaka | link | issue19887 messages |
2013-12-05 13:05:41 | serhiy.storchaka | create | |
|