Skip to content
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

Closed
eMPee584 mannequin opened this issue Jul 20, 2017 · 10 comments
Closed

Update os.samefile docstring to match documentation #75157

eMPee584 mannequin opened this issue Jul 20, 2017 · 10 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@eMPee584
Copy link
Mannequin

eMPee584 mannequin commented Jul 20, 2017

BPO 30974
Nosy @bitdancer, @zooba, @eMPee584, @miss-islington, @iritkatriel
PRs
  • bpo-30974: fix os.path.samefile docstring with docs #7337
  • [3.8] bpo-30974: Change os.path.samefile docstring to match docs (GH-7337) #15086
  • [3.7] bpo-30974: Change os.path.samefile docstring to match docs (GH-7337) #15087
  • 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:

    assignee = None
    closed_at = <Date 2020-09-21.16:30:18.661>
    created_at = <Date 2017-07-20.08:07:10.749>
    labels = ['3.8', 'type-bug', '3.7', 'docs']
    title = 'Update os.samefile docstring to match documentation'
    updated_at = <Date 2020-09-21.16:30:18.660>
    user = 'https://github.com/eMPee584'

    bugs.python.org fields:

    activity = <Date 2020-09-21.16:30:18.660>
    actor = 'steve.dower'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2020-09-21.16:30:18.661>
    closer = 'steve.dower'
    components = ['Documentation']
    creation = <Date 2017-07-20.08:07:10.749>
    creator = 'eMPee584'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 30974
    keywords = ['patch']
    message_count = 10.0
    messages = ['298708', '298731', '322555', '322556', '348928', '348929', '348930', '348932', '348933', '377161']
    nosy_count = 6.0
    nosy_names = ['r.david.murray', 'docs@python', 'steve.dower', 'eMPee584', 'miss-islington', 'iritkatriel']
    pr_nums = ['7337', '15086', '15087']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue30974'
    versions = ['Python 2.7', 'Python 3.7', 'Python 3.8']

    @eMPee584
    Copy link
    Mannequin Author

    eMPee584 mannequin commented Jul 20, 2017

    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.

    @eMPee584 eMPee584 mannequin added the type-bug An unexpected behavior, bug, or error label Jul 20, 2017
    @bitdancer
    Copy link
    Member

    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.

    @bitdancer bitdancer added 3.7 (EOL) end of life docs Documentation in the Doc dir labels Jul 20, 2017
    @bitdancer bitdancer changed the title os.samefile / shutil._samefile: following symlinks Update os.samefile docstring to match documentation Jul 20, 2017
    @csabella csabella added easy 3.8 only security fixes labels Mar 4, 2018
    @zooba
    Copy link
    Member

    zooba commented Jul 28, 2018

    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.

    @zooba
    Copy link
    Member

    zooba commented Jul 28, 2018

    Sorry, I meant the docs after the patch. Before, it's fine.

    @zooba zooba removed the easy label Jul 28, 2018
    @zooba
    Copy link
    Member

    zooba commented Aug 2, 2019

    New changeset 8e568ef by Steve Dower (Timo Furrer) in branch 'master':
    bpo-30974: Change os.path.samefile docstring to match docs (GH-7337)
    8e568ef

    @zooba
    Copy link
    Member

    zooba commented Aug 2, 2019

    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!

    @zooba
    Copy link
    Member

    zooba commented Aug 2, 2019

    Still needs a 2.7 backport if someone would like to do it.

    @miss-islington
    Copy link
    Contributor

    New changeset 6b83390 by Miss Islington (bot) in branch '3.8':
    bpo-30974: Change os.path.samefile docstring to match docs (GH-7337)
    6b83390

    @miss-islington
    Copy link
    Contributor

    New changeset a49f203 by Miss Islington (bot) in branch '3.7':
    bpo-30974: Change os.path.samefile docstring to match docs (GH-7337)
    a49f203

    @iritkatriel
    Copy link
    Member

    Since backport to 2.7 is no longer relevant, I think this issue can be closed.

    @zooba zooba closed this as completed Sep 21, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    5 participants