Repository: incubator-airflow
Updated Branches:
  refs/heads/master cf2605d3e -> 2a5883793


[AIRFLOW-1344] Fix text encoding bug when reading logs for Python 3.5

Closes #2394 from anselmwang/master


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/2a588379
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/2a588379
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/2a588379

Branch: refs/heads/master
Commit: 2a588379351b6d26c3caacce71b85044877a330c
Parents: cf2605d
Author: Yu Wang 1 <[email protected]>
Authored: Fri Jun 23 14:38:49 2017 -0700
Committer: Chris Riccomini <[email protected]>
Committed: Fri Jun 23 14:38:52 2017 -0700

----------------------------------------------------------------------
 airflow/task_runner/base_task_runner.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/2a588379/airflow/task_runner/base_task_runner.py
----------------------------------------------------------------------
diff --git a/airflow/task_runner/base_task_runner.py 
b/airflow/task_runner/base_task_runner.py
index 1ac822d..6b50a98 100644
--- a/airflow/task_runner/base_task_runner.py
+++ b/airflow/task_runner/base_task_runner.py
@@ -89,7 +89,9 @@ class BaseTaskRunner(LoggingMixin):
 
     def _read_task_logs(self, stream):
         while True:
-            line = stream.readline().decode('utf-8')
+            line = stream.readline()
+            if isinstance(line, bytes):
+                line = line.decode('utf-8')
             if len(line) == 0:
                 break
             self.logger.info('Subtask: {}'.format(line.rstrip('\n')))

Reply via email to