summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-05-23 12:17:05 (GMT)
committerGuido van Rossum <guido@python.org>1994-05-23 12:17:05 (GMT)
commitf3b4903a9f24ba2a9af3f26b8f402ef7bce52a2f (patch)
tree0d1d985b6cd3b375d11226ce22a9ea99a61efa81
parentf624666eb31f3e6aaf4da7a5aa0837cfd208608b (diff)
downloadcpython-f3b4903a9f24ba2a9af3f26b8f402ef7bce52a2f.zip
cpython-f3b4903a9f24ba2a9af3f26b8f402ef7bce52a2f.tar.gz
cpython-f3b4903a9f24ba2a9af3f26b8f402ef7bce52a2f.tar.bz2
dospath: fix by Amrit (don't normalize glob patterns away)
ftplib: get rid of non-auto port assignment
-rw-r--r--Lib/dospath.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Lib/dospath.py b/Lib/dospath.py
index 1479e1b..770174f 100644
--- a/Lib/dospath.py
+++ b/Lib/dospath.py
@@ -10,6 +10,12 @@ import string
# backslashes and maps invalid consecutive characters to a single '_'.
# Other normalizations (such as optimizing '../' away) are not allowed
# (this is done by normpath).
+#
+# Amrit: Things that can be valid regular expressions cannot be normalized
+# away. (which is pretty much all special characters)
+#
+# I am assuming that at least these chars may be used:
+# [, ], |, *, +, ?
mapchar = '_'
@@ -20,7 +26,7 @@ def normcase(s):
res = res + os.sep
elif c == '.' and res[-1:] == os.sep:
res = res + mapchar + c
- elif ord(c) < 32 or c in ' "*+,:;<=>?[]|':
+ elif ord(c) < 32 or c in ' ",:;<=>':
if res[-1:] != mapchar:
res = res + mapchar
else: