From a076db7d770f6802e58104b6139991a17662e9b4 Mon Sep 17 00:00:00 2001 From: Sean McQueen Date: Fri, 24 Jan 2020 13:51:42 -0500 Subject: [PATCH] [AIRFLOW-6625] Explicitly log using utf-8 encoding (#7247) 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 d424ac2236e22..12c1ec6ce50e4 100644 --- a/airflow/utils/log/file_task_handler.py +++ b/airflow/utils/log/file_task_handler.py @@ -53,7 +53,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') if self.formatter: self.handler.setFormatter(self.formatter) self.handler.setLevel(self.level)