-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
pathlib.Path.resolve() mishandles symlink loops #109187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Sep 9, 2023
…ve()` Treat symlink loops like other errors: in strict mode, raise `OSError`, and in non-strict mode, do not raise any exception.
barneygale
added a commit
to barneygale/cpython
that referenced
this issue
Sep 9, 2023
…ve()` Treat symlink loops like other errors: in strict mode, raise `OSError`, and in non-strict mode, do not raise any exception.
barneygale
added a commit
that referenced
this issue
Sep 26, 2023
…H-109192) Treat symlink loops like other errors: in strict mode, raise `OSError`, and in non-strict mode, do not raise any exception.
csm10495
pushed a commit
to csm10495/cpython
that referenced
this issue
Sep 28, 2023
…ve()` (pythonGH-109192) Treat symlink loops like other errors: in strict mode, raise `OSError`, and in non-strict mode, do not raise any exception.
Glyphack
pushed a commit
to Glyphack/cpython
that referenced
this issue
Sep 2, 2024
…ve()` (pythonGH-109192) Treat symlink loops like other errors: in strict mode, raise `OSError`, and in non-strict mode, do not raise any exception.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Bug description:
Two closely-related issues in
pathlib.Path.resolve()
:First,
resolve(strict=True)
raisesRuntimeError
rather thanOSError
when a symlink loop is encountered. This is done only for backwards compatibility, since #25264 made pathlib callos.path.realpath()
. It should raiseOSError(ELOOP)
Second,
resolve(strict=False)
suppresses every kind of OS error except symlink loop errors. Again this is only for backwards compatibility. It should suppress exceptions about symlink loops.Relevant code:
cpython/Lib/pathlib.py
Lines 1233 to 1252 in e21c89f
CPython versions tested on:
3.11, 3.12, CPython main branch
Operating systems tested on:
No response
Linked PRs
pathlib.Path.resolve()
#109192The text was updated successfully, but these errors were encountered: