You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by bo...@apache.org on 2017/07/11 18:43:05 UTC

incubator-airflow git commit: [AIRFLOW-1387] Add unicode string prefix

Repository: incubator-airflow
Updated Branches:
  refs/heads/master 6b8d957a3 -> 208e9a284


[AIRFLOW-1387] Add unicode string prefix

Python's format function has a feature of encoding
the supplied
variable with the same encoding as a string where
substitution will
take place. In case the string is not originally
specified as unicode
default encoding will be used. This will yield an
error if
sys.getdefaultencoding() is not 'utf-8' because it
will try to encode
previously utf8 decoded string (with unicode
chars) as non unicode.
Solution based on SO 5082452.

Closes #2426 from artiom33/logger_unicode_fix1


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

Branch: refs/heads/master
Commit: 208e9a28435c917b504af852f9d33e8ff405a296
Parents: 6b8d957
Author: artiom33 <ar...@prismfp.com>
Authored: Tue Jul 11 20:42:58 2017 +0200
Committer: Bolke de Bruin <bo...@xs4all.nl>
Committed: Tue Jul 11 20:42:58 2017 +0200

----------------------------------------------------------------------
 airflow/task_runner/base_task_runner.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/208e9a28/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 6b50a98..fa3fd6b 100644
--- a/airflow/task_runner/base_task_runner.py
+++ b/airflow/task_runner/base_task_runner.py
@@ -94,7 +94,7 @@ class BaseTaskRunner(LoggingMixin):
                 line = line.decode('utf-8')
             if len(line) == 0:
                 break
-            self.logger.info('Subtask: {}'.format(line.rstrip('\n')))
+            self.logger.info(u'Subtask: {}'.format(line.rstrip('\n')))
 
     def run_command(self, run_with, join_args=False):
         """