Browse Source

[utils:sanitize_path] Disallow trailing whitespace in path segment (Closes #7332)

totalwebcasting
Sergey M․ 9 years ago
parent
commit
c90d16cf36
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      youtube_dl/utils.py

+ 1
- 1
youtube_dl/utils.py View File

@ -366,7 +366,7 @@ def sanitize_path(s):
if drive_or_unc: if drive_or_unc:
norm_path.pop(0) norm_path.pop(0)
sanitized_path = [ sanitized_path = [
path_part if path_part in ['.', '..'] else re.sub('(?:[/<>:"\\|\\\\?\\*]|\.$)', '#', path_part)
path_part if path_part in ['.', '..'] else re.sub('(?:[/<>:"\\|\\\\?\\*]|[\s.]$)', '#', path_part)
for path_part in norm_path] for path_part in norm_path]
if drive_or_unc: if drive_or_unc:
sanitized_path.insert(0, drive_or_unc + os.path.sep) sanitized_path.insert(0, drive_or_unc + os.path.sep)


Loading…
Cancel
Save