-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixesstdlibPython modules in the Lib dirPython modules in the Lib dir
Description
If os.path.realpath()
encounters a symlink loop on posix, it prematurely stops querying paths and resolving symlink targets. This differs from coreutils realpath
:
$ cd /tmp
$ ln -s loop loop
$ ln -s target link
$ realpath -m loop/../link
/tmp/target
$ python -c 'import os.path; print(os.path.realpath("loop/../link"))'
/tmp/link
It also differs from how lstat()
errors are handled:
$ realpath -m missing/../link
/tmp/target
$ python -c 'import os.path; print(os.path.realpath("missing/../link"))'
/tmp/target
Linked PRs
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixesstdlibPython modules in the Lib dirPython modules in the Lib dir