You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/01/20 02:28:26 UTC

[GitHub] [airflow] microhuang edited a comment on issue #20966: Exception when parsing log

microhuang edited a comment on issue #20966:
URL: https://github.com/apache/airflow/issues/20966#issuecomment-1017056466


   When the task outputs some strange characters, there will be errors when using UTF-8 decoding due to different encoding. The same problem also exists in (airflow/hooks/subprocess.py : line 88 : version 2.2.3). You should try to catch it. I will submit a PR later.
   
   e.g.
   
   ```
               line = ''
               for raw_line in iter(self.sub_process.stdout.readline, b''):
                   try:
                       line = raw_line.decode(output_encoding).rstrip()
                   except UnicodeDecodeError as err:
                       print(err, output_encoding, raw_line)
                   self.log.info("%s", line)
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org