projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
95649b3
)
Only encode when output stream is binary
author
Philipp Hagemeister
<phihag@phihag.de>
Tue, 27 Nov 2012 20:07:25 +0000
(21:07 +0100)
committer
Philipp Hagemeister
<phihag@phihag.de>
Tue, 27 Nov 2012 20:07:25 +0000
(21:07 +0100)
youtube_dl/FileDownloader.py
patch
|
blob
|
history
diff --git
a/youtube_dl/FileDownloader.py
b/youtube_dl/FileDownloader.py
index 6d52dc923d67fcc4fe3b4e0a2046f601a04e855e..4e9b55f49268fbf22bf5c6057ee13de94b663007 100644
(file)
--- a/
youtube_dl/FileDownloader.py
+++ b/
youtube_dl/FileDownloader.py
@@
-179,7
+179,7
@@
class FileDownloader(object):
if not self.params.get('quiet', False):
terminator = [u'\n', u''][skip_eol]
output = message + terminator
- if 'b'
not in self._screen_file.mode
or sys.version_info[0] < 3: # Python 2 lies about the mode of sys.stdout/sys.stderr
+ if 'b'
in getattr(self._screen_file, 'mode', '')
or sys.version_info[0] < 3: # Python 2 lies about the mode of sys.stdout/sys.stderr
output = output.encode(preferredencoding(), 'ignore')
self._screen_file.write(output)
self._screen_file.flush()