浏览代码

[--load-info] Always read file as UTF-8

This allows editing the file (and not escaping non-ASCII characters) and reloading it in.
Philipp Hagemeister 12 年之前
父节点
当前提交
395293a889
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      youtube_dl/YoutubeDL.py

+ 1 - 2
youtube_dl/YoutubeDL.py

@@ -883,8 +883,7 @@ class YoutubeDL(object):
         return self._download_retcode
 
     def download_with_info_file(self, info_filename):
-        with open(info_filename, 'r') as f:
-            # TODO: Check for errors
+        with io.open(info_filename, 'r', encoding='utf-8') as f:
             info = json.load(f)
         try:
             self.process_ie_result(info, download=True)