[Python-checkins] cpython (3.2): ntpath.samefile fails to detect that "A.TXT" and "a.txt" refer to the same file

ronald.oussoren python-checkins at python.org
Fri May 6 17:11:50 CEST 2011


http://hg.python.org/cpython/rev/011e4bb8b933
changeset:   69876:011e4bb8b933
branch:      3.2
parent:      69874:d4c2a99d1bad
user:        Ronald Oussoren <ronaldoussoren at mac.com>
date:        Fri May 06 17:11:07 2011 +0200
summary:
  ntpath.samefile fails to detect that "A.TXT" and "a.txt" refer to the same file on Windows XP.

Noticed while researching a buildbot failure due to a patch for issue #10684.

files:
  Lib/ntpath.py |  2 +-
  Misc/NEWS     |  3 +++
  2 files changed, 4 insertions(+), 1 deletions(-)


diff --git a/Lib/ntpath.py b/Lib/ntpath.py
--- a/Lib/ntpath.py
+++ b/Lib/ntpath.py
@@ -654,7 +654,7 @@
     # Non-Windows operating systems fake this method with an XP
     # approximation.
     def _getfinalpathname(f):
-        return abspath(f)
+        return normcase(abspath(f))
 
 def samefile(f1, f2):
     "Test whether two pathnames reference the same actual file"
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -83,6 +83,9 @@
 Library
 -------
 
+- ntpath.samefile failed to notice that "a.txt" and "A.TXT" refer to the same
+  file on Windows XP. As noticed in issue #10684.
+
 - Issue #12000: When a SSL certificate has a subjectAltName without any
   dNSName entry, ssl.match_hostname() should use the subject's commonName.
   Patch by Nicolas Bareil.

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list