[
https://issues.apache.org/jira/browse/AIRFLOW-1239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16126496#comment-16126496
]
ASF subversion and git services commented on AIRFLOW-1239:
----------------------------------------------------------
Commit 42cad60698646f617537a7f4ba713fd6b3fc2ecb in incubator-airflow's branch
refs/heads/master from [~ahaidrey]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=42cad60 ]
[AIRFLOW-1239] Fix unicode error for logs in base_task_runner
The details here are that there exists a PR for
this JIRA already (https://github.com/apache/incubator-
airflow/pull/2318). The issue is that in python 2.7 not
all literals are automatically unicode like they
are in python 3. That's what's the root cause, and
that can simply be fixed by just explicitly
stating all literals should be treated as unicode,
which is an import from the `__future__` module.
https://stackoverflow.com/questions/3235386/python-using-format-on-
a-unicode-escaped-string also explains this
same solution, which I found helpful.
Closes #2496 from Acehaidrey/master
> base_task_runner logging with unicode values on Py27
> ----------------------------------------------------
>
> Key: AIRFLOW-1239
> URL: https://issues.apache.org/jira/browse/AIRFLOW-1239
> Project: Apache Airflow
> Issue Type: Bug
> Components: worker
> Reporter: yanghanbing
>
> Exception in thread Thread-1:
> Traceback (most recent call last):
> File "/usr/lib64/python2.7/threading.py", line 811, in __bootstrap_inner
> self.run()
> File "/usr/lib64/python2.7/threading.py", line 764, in run
> self.__target(*self.__args, **self.__kwargs)
> File
> "/opt/cloudera-manager/cm-5.5.1/run/cloudera-scm-server/airflow/env/lib/python2.7/site-packages/airflow/task_runner/base_task_runner.py",
> line 95, in _read_task_logs
> self.logger.info('Subtask: {}'.format(line.rstrip('\n')))
> UnicodeEncodeError: 'ascii' codec can't encode characters in position
> 107-108: ordinal not in range(128)
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)