[utils] Disallow trailing dot in sanitize_path for a path part
This commit is contained in:
parent
1bb5c511a5
commit
f18ef2d144
2 changed files with 12 additions and 1 deletions
|
@ -319,7 +319,7 @@ def sanitize_path(s):
|
|||
if unc_or_drive:
|
||||
norm_path.pop(0)
|
||||
sanitized_path = [
|
||||
re.sub('[/<>:"\\|\\\\?\\*]', '#', path_part)
|
||||
re.sub('(?:[/<>:"\\|\\\\?\\*]|\.$)', '#', path_part)
|
||||
for path_part in norm_path]
|
||||
if unc_or_drive:
|
||||
sanitized_path.insert(0, unc_or_drive + os.path.sep)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue