projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a8d5316
)
[utils] Ensure RFC3986 encoding result is unicode
author
dirkf
<fieldhouse@gmx.net>
Sat, 20 Aug 2022 23:19:19 +0000
(
00:19
+0100)
committer
dirkf
<fieldhouse@gmx.net>
Sat, 20 Aug 2022 23:45:06 +0000
(
00:45
+0100)
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index a5f584ec57283613bab12d84555513dd92dfc343..fea38ed32e970a8944168552d8fd0a38961da6bb 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-3970,7
+3970,8
@@
def escape_rfc3986(s):
"""Escape non-ASCII characters as suggested by RFC 3986"""
if sys.version_info < (3, 0) and isinstance(s, compat_str):
s = s.encode('utf-8')
- return compat_urllib_parse.quote(s, b"%/;:@&=+$,!~*'()?#[]")
+ # ensure unicode: after quoting, it can always be converted
+ return compat_str(compat_urllib_parse.quote(s, b"%/;:@&=+$,!~*'()?#[]"))
def escape_url(url):