summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-08-26 16:35:26 (GMT)
committerGuido van Rossum <guido@python.org>1996-08-26 16:35:26 (GMT)
commit3df7b5a5466f6977da8a68d1aec1566b6ae871bb (patch)
treee94d28c25ead5d9a52ce9fea4c55d31c46b46d07
parentc75db0b7f482a0dea0a249cc7337aa8cf667853b (diff)
downloadcpython-3df7b5a5466f6977da8a68d1aec1566b6ae871bb.zip
cpython-3df7b5a5466f6977da8a68d1aec1566b6ae871bb.tar.gz
cpython-3df7b5a5466f6977da8a68d1aec1566b6ae871bb.tar.bz2
Don't do truncation to 8+3 format -- this is used on NT file systems!
-rw-r--r--Lib/ntpath.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/Lib/ntpath.py b/Lib/ntpath.py
index 053092a..d67e856 100644
--- a/Lib/ntpath.py
+++ b/Lib/ntpath.py
@@ -312,7 +312,8 @@ def expandvars(path):
# Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A/B.
-# Also, components of the path are silently truncated to 8+3 notation.
+# Previously, this function also truncated pathnames to 8+3 format,
+# but as this module is called "ntpath", that's obviously wrong!
def normpath(path):
path = normcase(path)
@@ -331,17 +332,9 @@ def normpath(path):
i = i-1
elif comps[i] == '' and i > 0 and comps[i-1] <> '':
del comps[i]
- elif '.' in comps[i]:
- comp = string.splitfields(comps[i], '.')
- comps[i] = comp[0][:8] + '.' + comp[1][:3]
- i = i+1
- elif len(comps[i]) > 8:
- comps[i] = comps[i][:8]
- i = i+1
else:
i = i+1
# If the path is now empty, substitute '.'
if not prefix and not comps:
comps.append('.')
return prefix + string.joinfields(comps, os.sep)
-