From 98a1ca97769d51afac559cc9c967939cd0954c58 Mon Sep 17 00:00:00 2001 From: Sean McQueen Date: Fri, 24 Jan 2020 16:40:35 -0500 Subject: [PATCH] [AIRFLOW-6625] Explicitly log using utf-8 encoding (#7247) (#31) This is the standard encoding supported by Airflow. We should be explicit about logging using this encoding. --- airflow/utils/log/file_task_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airflow/utils/log/file_task_handler.py b/airflow/utils/log/file_task_handler.py index 627c8755707ef..114d3c04fd449 100644 --- a/airflow/utils/log/file_task_handler.py +++ b/airflow/utils/log/file_task_handler.py @@ -52,7 +52,7 @@ def set_context(self, ti): :param ti: task instance object """ local_loc = self._init_file(ti) - self.handler = logging.FileHandler(local_loc) + self.handler = logging.FileHandler(local_loc, encoding='utf-8') self.handler.setFormatter(self.formatter) self.handler.setLevel(self.level)