aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Garcia <sarbalap+freshmeat@gmail.com>2009-07-13 15:25:14 +0200
committerRicardo Garcia <sarbalap+freshmeat@gmail.com>2010-10-31 11:24:43 +0100
commit7eb0e897429e1a85b185143b72a656ca8175501c (patch)
tree41b13e5959ae460d9503a69710ee05ef174d55d7
parent8b07dec5f6492af73e8621fd9aa23b03290662aa (diff)
Properly encode messages sent to stderr (fixes issue #34)
-rwxr-xr-xyoutube-dl4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube-dl b/youtube-dl
index 0fd160c2a..36b6331cb 100755
--- a/youtube-dl
+++ b/youtube-dl
@@ -227,7 +227,7 @@ class FileDownloader(object):
def to_stderr(self, message):
"""Print message to stderr."""
- print >>sys.stderr, message
+ print >>sys.stderr, message.encode(locale.getpreferredencoding())
def fixed_template(self):
"""Checks if the output template is fixed."""
@@ -308,7 +308,7 @@ class FileDownloader(object):
except (ValueError, KeyError), err:
self.trouble('ERROR: invalid output template or system charset: %s' % str(err))
if self.params['nooverwrites'] and os.path.exists(filename):
- self.to_stderr('WARNING: file exists: %s; skipping' % filename)
+ self.to_stderr(u'WARNING: file exists: %s; skipping' % filename)
return
try: