A feature-rich command-line audio/video downloader
[utils] `sanitize_path`: Fix when path is empty string
pukkandan4abea8ca0af0
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.pyindex 7af7a9fb97..d4f8d8cab1 100644--- a/yt_dlp/YoutubeDL.py+++ b/yt_dlp/YoutubeDL.py@@ -2237,7 +2237,7 @@ class YoutubeDL(object):matches = LazyList(_check_formats(matches[::-1 if format_reverse else 1]))try:yield matches[format_idx - 1]- except IndexError:+ except LazyList.IndexError:returnfilters = [self._build_format_filter(f) for f in selector.filters]diff --git a/yt_dlp/utils.py b/yt_dlp/utils.pyindex 84b2603dff..ba9566cab1 100644--- a/yt_dlp/utils.py+++ b/yt_dlp/utils.py@@ -778,7 +778,7 @@ def sanitize_path(s, force=False):for path_part in norm_path]if drive_or_unc:sanitized_path.insert(0, drive_or_unc + os.path.sep)- elif force and s[0] == os.path.sep:+ elif force and s and s[0] == os.path.sep:sanitized_path.insert(0, os.path.sep)return os.path.join(*sanitized_path)