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()
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: