Message135297
This seems to be a bug in ntpath.samefile, in particular in this code:
# determine if two files are in fact the same file
try:
# GetFinalPathNameByHandle is available starting with Windows 6.0.
# Windows XP and non-Windows OS'es will mock _getfinalpathname.
if sys.getwindowsversion()[:2] >= (6, 0):
from nt import _getfinalpathname
else:
raise ImportError
except (AttributeError, ImportError):
# On Windows XP and earlier, two files are the same if their absolute
# pathnames are the same.
# Non-Windows operating systems fake this method with an XP
# approximation.
def _getfinalpathname(f):
return abspath(f)
def samefile(f1, f2):
"Test whether two pathnames reference the same actual file"
return _getfinalpathname(f1) == _getfinalpathname(f2)
Python2 doesn't have ntpath.samefile and shutil then falls back to comparing "os.path.normcase(os.path.abspath(src))" with the same transformation of dst.
On XP _getfinalpath doesn't call os.path.normcase, hence it doesn't notice that "a" and "A" refer to the same file (on all common NT filesystems) |
|
Date |
User |
Action |
Args |
2011-05-06 14:34:45 | ronaldoussoren | set | recipients:
+ ronaldoussoren, orsenthil, tim.golden, nadeem.vawda, heikki, tarek, brian.curtin, santoso.wijaya, nooB, python-dev |
2011-05-06 14:34:45 | ronaldoussoren | set | messageid: <1304692485.09.0.31472123634.issue10684@psf.upfronthosting.co.za> |
2011-05-06 14:34:44 | ronaldoussoren | link | issue10684 messages |
2011-05-06 14:34:43 | ronaldoussoren | create | |
|