0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-10 00:25:06 +00:00

[utils] Jython support - handle filenames correctly

Now test:youtube downloads
This commit is contained in:
Yen Chi Hsuan 2016-03-03 18:47:54 +08:00
parent 101067de12
commit 8ee239e921

View file

@ -467,6 +467,10 @@ def encodeFilename(s, for_subprocess=False):
if not for_subprocess and sys.platform == 'win32' and sys.getwindowsversion()[0] >= 5: if not for_subprocess and sys.platform == 'win32' and sys.getwindowsversion()[0] >= 5:
return s 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') return s.encode(get_subprocess_encoding(), 'ignore')