projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
480b6c1
)
Work around a Python bug on Windows with UTF-8 configuration (#820)
author
Philipp Hagemeister
<phihag@phihag.de>
Sat, 4 May 2013 05:09:50 +0000
(07:09 +0200)
committer
Philipp Hagemeister
<phihag@phihag.de>
Sat, 4 May 2013 05:09:50 +0000
(07:09 +0200)
youtube_dl/__init__.py
patch
|
blob
|
history
diff --git
a/youtube_dl/__init__.py
b/youtube_dl/__init__.py
index dfcaccafa4afeddb2df5161180c97a7559f4d0a8..b8a82f932cddb927d0b2de7c31737a998b5f0bf2 100644
(file)
--- a/
youtube_dl/__init__.py
+++ b/
youtube_dl/__init__.py
@@
-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