airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sushant Karki (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AIRFLOW-1144) Logging causes UnicodeEncodeError when using Japanese characters
Date Tue, 25 Apr 2017 07:48:04 GMT

     [ 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.

{code}
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)
{code}

  was:
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.
> {code}
> 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)
> {code}



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

Mime
View raw message