Narendra-Neerukonda commented on a change in pull request #17965:
URL: https://github.com/apache/airflow/pull/17965#discussion_r701211786
##########
File path: airflow/utils/log/file_task_handler.py
##########
@@ -116,7 +116,7 @@ def _read(self, ti, try_number, metadata=None):
if os.path.exists(location):
try:
- with open(location) as file:
+ with open(location, encoding="utf-8") as file:
Review comment:
Makes sense. I feel, we should use 'surrogateescape' as replacement as
it will provide the exact bytes that caused the issue, making it more specific
for user to debug if they desire to do so.
And yes, it would definetly be better to have a config to set the encoding.
I have updated the PR with replacement as surrogate character as of now and
created a feature request #17993 and would like to work on this requirement.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]