-
-
Notifications
You must be signed in to change notification settings - Fork 30k
-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Update os.samefile docstring to match documentation #75157
Comments
Don't know whether it should be considered a documentation or behavioral issue, but os.samefile calls os.stat() on given files, following symlinks. Does this really "test whether two pathnames reference the same actual file"? I'd consider os.lstat() more suited for that. This bites me every time I want to overwrite a symlink with its referenced file using ranger. |
I would take "actual file" as meaning the file the symlink points to, so I'd say the documentation matches the implementation according to your description of the two. The current docs actually say "refer to the same file or directory", and mention os.stat explicitly, so again I'd say the docs and implementation match. It sounds like what you want is to open a feature request for a samefile equivalent that does not follow symlinks. lsamefile? We could use this issue for making the docstring match the docs, though. I think the sentence in the docs is short enough to just get copied into the docstring. |
I think the docs are too specific about the mechanism used here - if we document *how* it works then we may not be able to make it work correctly (with a different mechanic) on a different platform. |
Sorry, I meant the docs after the patch. Before, it's fine. |
I'm not personally thrilled about it being documented like this, but it's certainly how the current documentation reads. Consistency is better until we get motivated enough to fix all of it. Thanks for the patch! |
Still needs a 2.7 backport if someone would like to do it. |
Since backport to 2.7 is no longer relevant, I think this issue can be closed. |
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: