Files
cpython/Lib/posixpath.py
Barney Gale fd4b5453df GH-118289: Fix handling of non-directories in posixpath.realpath() (#120127)
In strict mode, raise `NotADirectoryError` if we encounter a non-directory
while we still have path parts left to process.

We use a `part_count` variable rather than `len(rest)` because the `rest`
stack also contains markers for unresolved symlinks.
2024-11-13 22:59:32 +00:00

18 KiB