浏览代码

Fix delayed title display in --console-title

With Python 3, the titlebar wouldn't get updated for a long time (due to
stderr buffering), and when it did, the title would be shown as b'...'
representation.
Mantas Mikulėnas 12 年之前
父节点
当前提交
906417c7c5
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      youtube_dl/FileDownloader.py

+ 1 - 1
youtube_dl/FileDownloader.py

@@ -208,7 +208,7 @@ class FileDownloader(object):
             # already of type unicode()
             ctypes.windll.kernel32.SetConsoleTitleW(ctypes.c_wchar_p(message))
         elif 'TERM' in os.environ:
-            sys.stderr.write('\033]0;%s\007' % message.encode(preferredencoding()))
+            self.to_screen('\033]0;%s\007' % message, skip_eol=True)
 
     def fixed_template(self):
         """Checks if the output template is fixed."""