-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Add Path.lexist() to pathlib #78318
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
When using pathlib to manipulate paths that may be symlinks or regular files, a pattern that comes up frequently is this expression: path.is_symlink() or path.exists() os.path.lexists(path) can be used for this, but when using pathlib going back to os.path for this seems like defeat. |
I haven't contributed to Python yet and I can contribute this as a way for me to practice the PR process in Python. As this is a small addition, should I create a PR right away, or wait for a consensus here? |
If you're okay with the PR being rejected because the decision is the method isn't desired, then feel free to go ahead and create a PR, Engin! But if you want to a better chance that it will eventually go in then I would wait for consensus. |
Thanks for the response Brett! I am not going to rush, then. But if I happen to have some free time and motivation to create the PR, I will just do it. I don't mind revising or getting rejected. |
I've come across this issue lately and proposed a PR which implements this and, analogous to os.stat(), adds a follow_symlinks parameter to Path.exists(). |
Closing as rejected -- see comments on the PR: #21157 (comment) |
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: