From 72cef81e1a1728962cb7eaa4ed9b526bf2aa9cff Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Mon, 11 Dec 2017 15:48:39 +0200 Subject: [PATCH] downloaders.py: PipeReader now works only with 'str' types PipeReader now works only with 'str' types and it's the callers responsibility to convert 'str' -> 'unicode' if he has to. Related to: #244 --- youtube_dl_gui/downloaders.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/youtube_dl_gui/downloaders.py b/youtube_dl_gui/downloaders.py index dae36fd..159ed6c 100644 --- a/youtube_dl_gui/downloaders.py +++ b/youtube_dl_gui/downloaders.py @@ -36,6 +36,10 @@ class PipeReader(Thread): Args: queue (Queue.Queue): Python queue to store the output of the subprocess. + Warnings: + All the operations are based on 'str' types. The caller has to convert + the queued items back to 'unicode' if he needs to. + """ WAIT_TIME = 0.1 @@ -54,7 +58,7 @@ class PipeReader(Thread): while self._running: if self._filedescriptor is not None: - for line in iter(self._filedescriptor.readline, ''): + for line in iter(self._filedescriptor.readline, str('')): # Ignore ffmpeg stderr if str('ffmpeg version') in line: ignore_line = True