Message280209
When using configparser read method, the file(s) remains opened and cannot be closed, causing ResourceWarning: unclosed file.
For example in the following code:
config = configparser.ConfigParser()
config.read(cfg_fn)
...
the file cfg_fn remains opened and is only closed upon destruction of the underlying file object. At some point in history the method read used to close the file, but this has been changed for some reason. |
|
Date |
User |
Action |
Args |
2016-11-07 16:49:02 | PetrPy | set | recipients:
+ PetrPy |
2016-11-07 16:49:02 | PetrPy | set | messageid: <1478537342.33.0.595722710962.issue28632@psf.upfronthosting.co.za> |
2016-11-07 16:49:02 | PetrPy | link | issue28632 messages |
2016-11-07 16:49:02 | PetrPy | create | |
|