X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Foptions.py;h=c4a85b2c09c17eb02123836a2341efc93fb6d283;hb=326fa4e6e52cb0d02c6026d8a2d32e34b8e99107;hp=5302b67cc3855ac8c06c21043ff3540cfe2ecf9b;hpb=672f01c37083dfc112f5baed2e76786693c1950d;p=youtube-dl diff --git a/youtube_dl/options.py b/youtube_dl/options.py index 5302b67cc..c4a85b2c0 100644 --- a/youtube_dl/options.py +++ b/youtube_dl/options.py @@ -26,7 +26,11 @@ def parseOpts(overrideArguments=None): except IOError: return default # silently skip if file is not present try: - res = compat_shlex_split(optionf.read(), comments=True) + # FIXME: https://github.com/rg3/youtube-dl/commit/dfe5fa49aed02cf36ba9f743b11b0903554b5e56 + contents = optionf.read() + if sys.version_info < (3,): + contents = contents.decode(preferredencoding()) + res = compat_shlex_split(contents, comments=True) finally: optionf.close() return res