You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While it should be closed in logging's shutdown [1], the following would
still issue a ResourceWarning:
```
import logging
log_file_handler = logging.FileHandler("temp.log", mode="w", encoding="UTF-8")
root_logger = logging.getLogger()
root_logger.addHandler(log_file_handler)
root_logger.removeHandler(log_file_handler)
root_logger.error("error")
del log_file_handler
```
It looks like the weakref might get lost for some reason.
See 92ffe42b45 / #4981
for more information.
1: https://github.com/python/cpython/blob/c1419578a18d787393c7ccee149e7c1fff17a99e/Lib/logging/__init__.py#L2107-L2139
0 commit comments