You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Sushant Karki (JIRA)" <ji...@apache.org> on 2017/04/25 07:46:04 UTC

[jira] [Updated] (AIRFLOW-1144) Logging causes UnicodeEncodeError when using Japanese characters

     [ https://issues.apache.org/jira/browse/AIRFLOW-1144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sushant Karki updated AIRFLOW-1144:
-----------------------------------
    Description: 
I am using the bash operator to pipe a sql dump to my database. Since, the encoding of my psql client is Japanese, the output displays some Japanese characters. Whenever the logger tries to log the output, it raises a UnicodeEncodeError.
Here are the details of the error.
```
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 813, in __bootstrap_inner
    self.run()
  File "/usr/lib64/python2.7/threading.py", line 766, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/karki/virtualenv/master/local/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 character u'\u884c' in position 58: ordinal not in range(128)
```

> Logging causes UnicodeEncodeError when using Japanese characters
> ----------------------------------------------------------------
>
>                 Key: AIRFLOW-1144
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-1144
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: logging, worker
>    Affects Versions: 1.8.0
>            Reporter: Sushant Karki
>
> I am using the bash operator to pipe a sql dump to my database. Since, the encoding of my psql client is Japanese, the output displays some Japanese characters. Whenever the logger tries to log the output, it raises a UnicodeEncodeError.
> Here are the details of the error.
> ```
> Exception in thread Thread-1:
> Traceback (most recent call last):
>   File "/usr/lib64/python2.7/threading.py", line 813, in __bootstrap_inner
>     self.run()
>   File "/usr/lib64/python2.7/threading.py", line 766, in run
>     self.__target(*self.__args, **self.__kwargs)
>   File "/home/karki/virtualenv/master/local/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 character u'\u884c' in position 58: ordinal not in range(128)
> ```



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)