Skip to content

posixpath.realpath(..., strict=True) doesn't limit symlinks #118441

Closed as not planned
@nineteendo

Description

@nineteendo

Bug report

Bug description:

>>> import posixpath
>>> posixpath.realpath("s/" * 33, strict=True)
'/Users/wannes/path-picker/link-test/dirs'

Expected OSError(errno.ELOOP, "Too many symbolic links", path) matching realpath on macOS:

wannes@Stefans-iMac dirs % realpath s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s
realpath: s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s/s: Too many levels of symbolic links

CPython versions tested on:

3.12

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions