浏览代码

[utils] Jython support - handle filenames correctly

Now test:youtube downloads
Yen Chi Hsuan 9 年之前
父节点
当前提交
8ee239e921
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      youtube_dl/utils.py

+ 4 - 0
youtube_dl/utils.py

@@ -467,6 +467,10 @@ def encodeFilename(s, for_subprocess=False):
     if not for_subprocess and sys.platform == 'win32' and sys.getwindowsversion()[0] >= 5:
         return s
 
+    # Jython assumes filenames are Unicode strings though reported as Python 2.x compatible
+    if sys.platform.startswith('java'):
+        return s
+
     return s.encode(get_subprocess_encoding(), 'ignore')