浏览代码

[utils] update_url_query: Encode the strings in the query dict

The test case with {'test': '第二行тест'} was failing on python 2 (the non-ascii characters were replaced with '?').
Jaime Marquínez Ferrándiz 9 年之前
父节点
当前提交
3233a68fbb
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      youtube_dl/utils.py

+ 1 - 0
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)))