This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: ntpath.samefile doesn't work for hard links
Type: behavior Stage: resolved
Components: Library (Lib), Windows Versions: Python 3.4
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brian.curtin Nosy List: brian.curtin, ocean-city, python-dev
Priority: normal Keywords:

Created on 2010-12-07 16:59 by brian.curtin, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg123564 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-12-07 16:59
ntpath.samefile is currently implemented using GetFinalPathNameByHandle, which doesn't work for hard links.

Since I introduced values for os.stat().st_ino in #8879 (which implemented, I suspect we can possibly change ntpath.samefile to be the same as posixfile.samefile and leave st_ino.

Hirokazu questioned whether or not that st_ino change was correct, but I think it will be fine on NTFS. As FAT does not support links anyways, there would be no issue with potential st_ino issues there as we wouldn't be comparing them for any reason.

(part of the reason I created this is that we have discussion on st_ino and samefile in a few different places and I'm losing track of where we're at)
msg178210 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-12-26 13:36
New changeset 9e980454b85e by Brian Curtin in branch 'default':
Add tests for Issue #10646.
msg178216 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2012-12-26 14:04
This was fixed as a result of #11939, and I've refactored the tests to add coverage of hard links in 9e980454b85e.

This was originally a bug report but it requires a 3.4 feature so it can't be fixed in 3.2 where it originally appeared.
Date User Action Args
2022-04-11 14:57:09adminsetgithub: 54855
2012-12-26 14:04:19brian.curtinsetstatus: open -> closed
versions: + Python 3.4, - Python 3.2
messages: + msg178216

resolution: fixed
stage: test needed -> resolved
2012-12-26 13:36:31python-devsetnosy: + python-dev
messages: + msg178210
2010-12-07 16:59:37brian.curtincreate