projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
732c848
)
[YoutubeDL] guard against strange sys.stdouts
author
Philipp Hagemeister
<phihag@phihag.de>
Wed, 12 Nov 2014 14:30:26 +0000
(15:30 +0100)
committer
Philipp Hagemeister
<phihag@phihag.de>
Wed, 12 Nov 2014 14:30:26 +0000
(15:30 +0100)
youtube_dl/YoutubeDL.py
patch
|
blob
|
history
diff --git
a/youtube_dl/YoutubeDL.py
b/youtube_dl/YoutubeDL.py
index 7951001fa746481b58d818300cbfdc1bbebb9879..5c875b4972f61e2ce925c40d13a94fa53fb059d3 100755
(executable)
--- a/
youtube_dl/YoutubeDL.py
+++ b/
youtube_dl/YoutubeDL.py
@@
-1306,11
+1306,13
@@
class YoutubeDL(object):
self.report_warning(
'Your Python is broken! Update to a newer and supported version')
+ stdout_encoding = getattr(
+ sys.stdout, 'encoding', 'missing (%s)' % type(sys.stdout).__name__)
encoding_str = (
'[debug] Encodings: locale %s, fs %s, out %s, pref %s\n' % (
locale.getpreferredencoding(),
sys.getfilesystemencoding(),
- s
ys.stdout.
encoding,
+ s
tdout_
encoding,
self.get_encoding()))
write_string(encoding_str, encoding=None)