mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-06-30 11:02:54 -05:00
[utils] Keep dot and dotdot unmodified (Closes #5171)
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user