micropython-lib icon indicating copy to clipboard operation
micropython-lib copied to clipboard

logging.StreamHandler should call super().__init__()

Open ulda opened this issue 1 year ago • 1 comments

logging.StreamHandler inherits from logging.Handler but does not call super().init() so it misses to initialize level and formatter instance variables

by the way, logging.Handler should initialize formatter to a working formatter, not None. e.g. if you create and add a new StreamHandler, it has no formatter set by default and any logging will generate an exception.

ulda avatar Jun 22 '23 17:06 ulda

I also encountered this issue, and have added a PR to fix in #710.

colin-nolan avatar Aug 05 '23 18:08 colin-nolan