Message320560
Calling logging.config.dictConfig several times with a file handler in the same Python process leaks resources.
INPUT:
$ python3 -Wall <<EOF
import logging.config
config = {
"version": 1,
"handlers": {
"file": {
"class": "logging.FileHandler",
"filename": "test.log"
}
},
"root": {
"handlers": ["file"]
}
}
logging.config.dictConfig(config)
logging.config.dictConfig(config)
EOF
OUTPUT:
/usr/lib/python3.6/logging/config.py:789: ResourceWarning: unclosed file <_io.TextIOWrapper name='/home/maggyero/test.log' mode='a' encoding='UTF-8'>
self.common_logger_config(root, config, incremental) |
|
Date |
User |
Action |
Args |
2018-06-27 09:29:16 | maggyero | set | recipients:
+ maggyero |
2018-06-27 09:29:16 | maggyero | set | messageid: <1530091756.08.0.56676864532.issue33978@psf.upfronthosting.co.za> |
2018-06-27 09:29:16 | maggyero | link | issue33978 messages |
2018-06-27 09:29:15 | maggyero | create | |
|