This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 2f1ed34 sets encoding to utf-8 by default while reading task logs
(#17965)
2f1ed34 is described below
commit 2f1ed34a7ec699bd027004d1ada847ed15f4aa4b
Author: Narendra-Neerukonda <[email protected]>
AuthorDate: Sun Sep 12 23:27:14 2021 +0530
sets encoding to utf-8 by default while reading task logs (#17965)
---
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 e453103..6d88c20 100644
--- a/airflow/utils/log/file_task_handler.py
+++ b/airflow/utils/log/file_task_handler.py
@@ -117,7 +117,7 @@ class FileTaskHandler(logging.Handler):
if os.path.exists(location):
try:
- with open(location) as file:
+ with open(location, encoding="utf-8",
errors="surrogateescape") as file:
log += f"*** Reading local file: {location}\n"
log += "".join(file.readlines())
except Exception as e: