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 2019/11/25 16:34:03 UTC

[GitHub] [airflow] feluelle commented on a change in pull request #6472: [AIRFLOW-6058] Running tests with pytest

feluelle commented on a change in pull request #6472: [AIRFLOW-6058] Running tests with pytest
URL: https://github.com/apache/airflow/pull/6472#discussion_r350275952
 
 

 ##########
 File path: airflow/utils/log/colored_log.py
 ##########
 @@ -89,6 +89,9 @@ def _color_record_traceback(self, record: LogRecord) -> LogRecord:
         return record
 
     def format(self, record: LogRecord) -> str:
-        record = self._color_record_args(record)
-        record = self._color_record_traceback(record)
-        return super().format(record)
+        try:
+            record = self._color_record_args(record)
+            record = self._color_record_traceback(record)
+            return super().format(record)
+        except ValueError:  # I/O operation on closed file
+            return Formatter().format(record)
 
 Review comment:
   Should we import the `Formatter` here? So it will only import if really required.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services