-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Pathlib .owner() and .group() methods fail on broken links #65521
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
Comments
Pathlib .owner() and .group() methods fail on broken symlinks. They use: It should be self.lstat(). Attached simple fix as unified diff. |
Most other Path methods operate on the link target, not the link itself, so I don't see why these methods would work otherwise. |
Mainly, 2 reasons:
|
A broken link is an error, so it's normal to have an exception raised
I sympathize with this. But you can already use Path.lstat() and inspect The fact that most Path methods dereference symlinks reflects the |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: