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/12/11 13:21:08 UTC

[GitHub] [airflow] ashb commented on a change in pull request #6767: [AIRFLOW-6208] Implement fileno in StreamLogWriter

ashb commented on a change in pull request #6767: [AIRFLOW-6208] Implement fileno in StreamLogWriter
URL: https://github.com/apache/airflow/pull/6767#discussion_r356593897
 
 

 ##########
 File path: airflow/utils/log/logging_mixin.py
 ##########
 @@ -116,6 +116,13 @@ def isatty(self):
         """
         return False
 
+    def fileno(self):
+        """
+        Returns the stdout file descriptor 1.
+        For compatibility reasons e.g python subprocess module stdout redirection.
+        """
+        return 1
 
 Review comment:
   This is wrong in many cases:
   
   - When the stream is stderr
   - When stdout is redirected, if something wrote to fd 1 directly (which is the purpose of this method) then it would by-pass the redirection.

----------------------------------------------------------------
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