From 12192bf05e7f987d2c2cacee306fd63b2dade936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Gonz=C3=A1lez=20Palomo?= Date: Sat, 15 Nov 2014 13:33:22 +0100 Subject: [PATCH] Workaround to deal with Phython bug in 2.6.0 - 2.6.4 youtube-dl imports unicode_literals from __future__, which makes the string literals used as keys for dictionaries to be unicode strings, but that's not supported until Python 2.6.5. This workaround labels them as binary strings using the "b" prefix, which keeps them as old-style strings. --- youtube_dl/options.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/youtube_dl/options.py b/youtube_dl/options.py index c182abfdc..21e71d8bf 100644 --- a/youtube_dl/options.py +++ b/youtube_dl/options.py @@ -106,10 +106,12 @@ def parseOpts(overrideArguments=None): fmt.format_option_strings = _format_option_string kw = { - 'version': __version__, - 'formatter': fmt, - 'usage': '%prog [options] url [url...]', - 'conflict_handler': 'resolve', + # The b prefix is for Python 2.6.0 - 2.6.4: + # http://bugs.python.org/issue2646 + b'version': __version__, + b'formatter': fmt, + b'usage': '%prog [options] url [url...]', + b'conflict_handler': 'resolve', } parser = optparse.OptionParser(**kw)