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

logging module: AttributeError: 'FileIO' object has no attribute 'flush' micropython 1.18 #73

Open
dlparker opened this issue Apr 21, 2022 · 1 comment

Comments

@dlparker
Copy link

The stream handler constructor called at the end of __init__.py initializes the _stream as stderr. This is a FileIO object, which does not have a "flush" method. This results in the above error.

Patching the StreamHandler class "flush" method to read like this solves the problem:

    def flush(self):
        if hasattr(self._stream, "flush"):
            self._stream.flush()

@alxkos
Copy link

alxkos commented Jan 12, 2024

same issue
v 1.22.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants