Commit 1e88a961 authored by Guido van Rossum's avatar Guido van Rossum

dospath: fix by Amrit (don't normalize glob patterns away)

ftplib: get rid of non-auto port assignment
parent 2aed0c31
...@@ -10,6 +10,12 @@ import string ...@@ -10,6 +10,12 @@ import string
# backslashes and maps invalid consecutive characters to a single '_'. # backslashes and maps invalid consecutive characters to a single '_'.
# Other normalizations (such as optimizing '../' away) are not allowed # Other normalizations (such as optimizing '../' away) are not allowed
# (this is done by normpath). # (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 = '_' mapchar = '_'
...@@ -20,7 +26,7 @@ def normcase(s): ...@@ -20,7 +26,7 @@ def normcase(s):
res = res + os.sep res = res + os.sep
elif c == '.' and res[-1:] == os.sep: elif c == '.' and res[-1:] == os.sep:
res = res + mapchar + c res = res + mapchar + c
elif ord(c) < 32 or c in ' "*+,:;<=>?[]|': elif ord(c) < 32 or c in ' ",:;<=>':
if res[-1:] != mapchar: if res[-1:] != mapchar:
res = res + mapchar res = res + mapchar
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment