uranusjr commented on code in PR #37347:
URL: https://github.com/apache/airflow/pull/37347#discussion_r1588796435


##########
airflow/utils/log/logging_mixin.py:
##########
@@ -147,18 +147,27 @@ def supports_external_link(self) -> bool:
 
 # We have to ignore typing errors here because Python I/O classes are a mess, 
and they do not
 # have the same type hierarchy defined as the `typing.IO` - they violate 
Liskov Substitution Principle
-# While it is ok to make your class derive from IOBase (and its good thing to 
do as they provide
+# While it is ok to make your class derive from TextIOBase (and its good thing 
to do as they provide
 # base implementation for IO-implementing classes, it's impossible to make 
them work with
 # IO generics (and apparently it has not even been intended)
 # See more: https://giters.com/python/typeshed/issues/6077
-class StreamLogWriter(IOBase, IO[str]):  # type: ignore[misc]
+class StreamLogWriter(TextIOBase, IO[str]):  # type: ignore[misc]
     """
     Allows to redirect stdout and stderr to logger.
 
-    :param log: The log level method to write to, ie. log.debug, log.warning
+    :param logger: The logging.Logger instance to write to
+    :param level: The log level method to write to, ie. logging.DEBUG, 
logging.WARNING
     """
 
-    encoding: None = None
+    encoding = "None"

Review Comment:
   Technically not _any_ value is encodable in UTF-8 but I get what you mean. 
If this must be a str, the built-in `undefined` encoding would be a better 
value. https://docs.python.org/3/library/codecs.html#text-encodings



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

Reply via email to