diff options
author | coletdjnz <coletdjnz@protonmail.com> | 2023-05-21 09:56:23 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-20 21:56:23 +0000 |
commit | 69bec6730ec9d724bcedeab199d9d684d61423ba (patch) | |
tree | 600deb0aa06c57ce0c6341a3b8ea0cd2f96b7a23 /yt_dlp/utils/_deprecated.py | |
parent | 23c39a4beadee382060bb47fdaa21316ca707d38 (diff) |
[cleanup, utils] Split into submodules (#7090)
Closes https://github.com/yt-dlp/yt-dlp/pull/2173
Authored by: pukkandan, coletdjnz
Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
Diffstat (limited to 'yt_dlp/utils/_deprecated.py')
-rw-r--r-- | yt_dlp/utils/_deprecated.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/yt_dlp/utils/_deprecated.py b/yt_dlp/utils/_deprecated.py new file mode 100644 index 000000000..4454d84a7 --- /dev/null +++ b/yt_dlp/utils/_deprecated.py @@ -0,0 +1,30 @@ +"""Deprecated - New code should avoid these""" + +from ._utils import preferredencoding + + +def encodeFilename(s, for_subprocess=False): + assert isinstance(s, str) + return s + + +def decodeFilename(b, for_subprocess=False): + return b + + +def decodeArgument(b): + return b + + +def decodeOption(optval): + if optval is None: + return optval + if isinstance(optval, bytes): + optval = optval.decode(preferredencoding()) + + assert isinstance(optval, str) + return optval + + +def error_to_compat_str(err): + return str(err) |