aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-03-10 00:50:11 +0600
committerSergey M․ <dstftw@gmail.com>2015-03-10 00:50:11 +0600
commit2ebfeacabc7b74d03fa7cb096d8b9d1ecbdbb6e4 (patch)
treea4a9f6cf81f6561ecd5df53b6660595f03d3ad25 /youtube_dl/utils.py
parentf5d8f58a170c9585e0913dbe1e50e0ed05afb698 (diff)
[utils] Keep dot and dotdot unmodified (Closes #5171)
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index d5597d514..c3135effc 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -319,7 +319,7 @@ def sanitize_path(s):
if unc_or_drive:
norm_path.pop(0)
sanitized_path = [
- re.sub('(?:[/<>:"\\|\\\\?\\*]|\.$)', '#', path_part)
+ path_part if path_part in ['.', '..'] else re.sub('(?:[/<>:"\\|\\\\?\\*]|\.$)', '#', path_part)
for path_part in norm_path]
if unc_or_drive:
sanitized_path.insert(0, unc_or_drive + os.path.sep)