Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing properties on logger #36992

Closed
2 tasks done
Grub4K opened this issue Jan 24, 2024 · 1 comment · Fixed by #37347
Closed
2 tasks done

Missing properties on logger #36992

Grub4K opened this issue Jan 24, 2024 · 1 comment · Fixed by #37347
Assignees
Labels
affected_version:main_branch Issues Reported for main branch area:core area:logging kind:bug This is a clearly a bug

Comments

@Grub4K
Copy link
Contributor

Grub4K commented Jan 24, 2024

Apache Airflow version

main (development)

If "Other Airflow 2 version" selected, which one?

No response

What happened?

Using 'b' in sys.stdout.mode (see yt-dlp/yt-dlp#8816) results in an error

What you think should happen instead?

sys.stdout and related should be of type TextIO. typing, line 3165 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

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?

  • Yes I am willing to submit a PR!

Code of Conduct

@Grub4K Grub4K added area:core kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet labels Jan 24, 2024
Copy link

boring-cyborg bot commented Jan 24, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected_version:main_branch Issues Reported for main branch area:core area:logging kind:bug This is a clearly a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants