aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMantas Mikulėnas <grawity@gmail.com>2013-02-09 22:58:12 +0200
committerMantas Mikulėnas <grawity@gmail.com>2013-02-09 22:58:12 +0200
commit906417c7c586218c5a61f9966ce7d67528f97b69 (patch)
tree2ade541b192f8d143a927782b52ab1fddd2d143b
parent6aabe82035b0c5eff8b1d343e08a484ff0c12e60 (diff)
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.
-rw-r--r--youtube_dl/FileDownloader.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/youtube_dl/FileDownloader.py b/youtube_dl/FileDownloader.py
index 49b032a1b..4f51ed8b0 100644
--- a/youtube_dl/FileDownloader.py
+++ b/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."""