SIGN IN SIGN UP

[3.13] GH-118289: Fix handling of non-directories in `posixpath.realpath()` (GH-120127) (#126815)

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.
(cherry picked from commit fd4b5453df74e249987553b12c14ad75fafa4991)
B
Barney Gale committed
b66728da05e2f959eafb46df94d240ac801e8a3e
Parent: ad1b23b
Committed by GitHub <noreply@github.com> on 11/13/2024, 11:32:56 PM