From 3233a68fbb1cb608534db43f358f7203e59cd2de Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?= Date: Fri, 4 Mar 2016 22:18:40 +0100 Subject: [PATCH] [utils] update_url_query: Encode the strings in the query dict MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The test case with {'test': '第二行тест'} was failing on python 2 (the non-ascii characters were replaced with '?'). --- youtube_dl/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index d431aa6b7..22a39a0ab 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -1743,6 +1743,7 @@ def update_url_query(url, query): parsed_url = compat_urlparse.urlparse(url) qs = compat_parse_qs(parsed_url.query) qs.update(query) + qs = encode_dict(qs) return compat_urlparse.urlunparse(parsed_url._replace( query=compat_urllib_parse.urlencode(qs, True))) -- 2.39.5