1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-11-22 01:02:57 +08:00

Work around a Python bug on Windows with UTF-8 configuration (#820)

This commit is contained in:
Philipp Hagemeister 2013-05-04 07:09:50 +02:00
parent 480b6c1e8b
commit 0d94f2474c

View File

@ -30,6 +30,7 @@ __authors__ = (
__license__ = 'Public Domain'
import codecs
import getpass
import optparse
import os
@ -335,6 +336,11 @@ def parseOpts(overrideArguments=None):
return parser, opts, args
def _real_main(argv=None):
# Compatibility fixes for Windows
if sys.platform == 'win32':
# https://github.com/rg3/youtube-dl/issues/820
codecs.register(lambda name: codecs.lookup('utf-8') if name == 'cp65001' else None)
parser, opts, args = parseOpts(argv)
# Open appropriate CookieJar