diff options
author | Sergey M․ <dstftw@gmail.com> | 2015-11-02 04:26:20 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-11-02 04:26:20 +0600 |
commit | c90d16cf36d8edf03f4dc923ee9dbeadca910844 (patch) | |
tree | a1634318f2b5b5a23ecdab0df4da9d446df0ede5 /youtube_dl | |
parent | ab6ca0480280abb2a35a54e1b380bbae07a48863 (diff) |
[utils:sanitize_path] Disallow trailing whitespace in path segment (Closes #7332)
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index efd5f4ae1..7b3f79141 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -366,7 +366,7 @@ def sanitize_path(s): if drive_or_unc: norm_path.pop(0) 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] if drive_or_unc: sanitized_path.insert(0, drive_or_unc + os.path.sep) |