From 1906c736b7a5441244d467f69cc9895a3415d661 Mon Sep 17 00:00:00 2001
From: Anisse Astier <anisse@astier.eu>
Date: Sat, 10 Aug 2013 23:24:51 +0200
Subject: [PATCH] Properly handle platform name containing UTF-8 characters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On Fedora 19, python's platform name is something like "Linux-3.10.4-300.fc19.x86_64-x86_64-with-fedora-19-Schrödinger’s_Cat"

This causes a UnicodeDecodeError when running youtube-dl in verbose mode.

This commit fixes it by decoding the platform name properly with the util function decodeOption()
---
 youtube_dl/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py
index bf040aacd..2960c9c59 100644
--- a/youtube_dl/__init__.py
+++ b/youtube_dl/__init__.py
@@ -597,7 +597,7 @@ def _real_main(argv=None):
                 sys.exc_clear()
             except:
                 pass
-        sys.stderr.write(u'[debug] Python version %s - %s' %(platform.python_version(), platform.platform()) + u'\n')
+        sys.stderr.write(u'[debug] Python version %s - %s\n' %(platform.python_version(), decodeOption(platform.platform())))
         sys.stderr.write(u'[debug] Proxy map: ' + str(proxy_handler.proxies) + u'\n')
 
     ydl.add_default_info_extractors()