[elbe-devel] [PATCH v2 10/27] log: call close() on log handlers that are removed

Bastian Germann bage at linutronix.de
Thu Sep 24 17:06:50 CEST 2020


Am 24.09.20 um 16:56 schrieb Torben Hohn:
> python3 now complains about files being closed during garbagecollection.
> 
> Call close() on loghandlers when they are removed.
> 
> Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>

Reviewed-by: Bastian Germann <bage at linutronix.de>

> ---
>  elbepack/log.py | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/elbepack/log.py b/elbepack/log.py
> index 2ef144c7a..22f747dab 100644
> --- a/elbepack/log.py
> +++ b/elbepack/log.py
> @@ -214,6 +214,7 @@ def close_logging():
>      if hasattr(local, "handlers"):
>          for h in local.handlers:
>              root.removeHandler(h)
> +            h.close()
>      local.handlers = []
>  
>  # TODO:py3 Remove object inheritance
> 


More information about the elbe-devel mailing list