A feature-rich command-line audio/video downloader
Simplified preferredencoding()
Arvydas Sidorenkobae611f216ac
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.pyindex 2853ba50f2..7faa046c8c 100644--- a/youtube_dl/utils.py+++ b/youtube_dl/utils.py@@ -32,15 +32,13 @@ def preferredencoding():Returns the best encoding scheme for the system, based onlocale.getpreferredencoding() and some further tweaks."""- def yield_preferredencoding():- try:- pref = locale.getpreferredencoding()- u'TEST'.encode(pref)- except:- pref = 'UTF-8'- while True:- yield pref- return yield_preferredencoding().next()+ try:+ pref = locale.getpreferredencoding()+ u'TEST'.encode(pref)+ except:+ pref = 'UTF-8'++ return prefdef htmlentity_transform(matchobj):