Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f3b4903

Browse files
committed
dospath: fix by Amrit (don't normalize glob patterns away)
ftplib: get rid of non-auto port assignment
1 parent f624666 commit f3b4903

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Lib/dospath.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
# backslashes and maps invalid consecutive characters to a single '_'.
1111
# Other normalizations (such as optimizing '../' away) are not allowed
1212
# (this is done by normpath).
13+
#
14+
# Amrit: Things that can be valid regular expressions cannot be normalized
15+
# away. (which is pretty much all special characters)
16+
#
17+
# I am assuming that at least these chars may be used:
18+
# [, ], |, *, +, ?
1319

1420
mapchar = '_'
1521

@@ -20,7 +26,7 @@ def normcase(s):
2026
res = res + os.sep
2127
elif c == '.' and res[-1:] == os.sep:
2228
res = res + mapchar + c
23-
elif ord(c) < 32 or c in ' "*+,:;<=>?[]|':
29+
elif ord(c) < 32 or c in ' ",:;<=>':
2430
if res[-1:] != mapchar:
2531
res = res + mapchar
2632
else:

0 commit comments

Comments
 (0)