You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Grub4K (via GitHub)" <gi...@apache.org> on 2024/01/24 08:52:39 UTC

[I] Missing properties on logger [airflow]

Grub4K opened a new issue, #36992:
URL: https://github.com/apache/airflow/issues/36992

   ### Apache Airflow version
   
   main (development)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   Using `'b' in sys.stdout.mode` (see https://github.com/yt-dlp/yt-dlp/issues/8816) results in an error
   
   ### What you think should happen instead?
   
   `sys.stdout` and related should be of type `TextIO`. [`typing`, line 3165](<https://github.com/python/cpython/blob/1e4f00ebd8db44a031b61eed0803b4c3d731aed7/Lib/typing.py#L3165>) suggests that TextIO should implement `mode`, `name`, and `encoding` as type `str` (alongside other, unrelated ones). Currently, the abstract method described in `TextIO` returns `None`, resulting in above error.
   
   ### How to reproduce
   
   ```py
   import sys
   import logging
   import contextlib
   from airflow.utils.log.logging_mixin import StreamLogWriter
   
   log = logging.getLogger("test")
   out = StreamLogWriter(log, logging.INFO)
   with contextlib.redirect_stdout(out):
       is_binary = "b" in sys.stdout.mode
       print(f"stdout {is_binary=}")
   ```
   resulting in
   ```
   TypeError: argument of type 'NoneType' is not iterable
   ```
   
   ### Operating System
   
   N/A
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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: commits-unsubscribe@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Missing properties on logger [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk closed issue #36992: Missing properties on logger
URL: https://github.com/apache/airflow/issues/36992


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Missing properties on logger [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #36992:
URL: https://github.com/apache/airflow/issues/36992#issuecomment-1907666343

   Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org