This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author PetrPy
Recipients PetrPy
Date 2016-11-07.16:49:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1478537342.33.0.595722710962.issue28632@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-11-07 16:49:02PetrPysetrecipients: + PetrPy
2016-11-07 16:49:02PetrPysetmessageid: <1478537342.33.0.595722710962.issue28632@psf.upfronthosting.co.za>
2016-11-07 16:49:02PetrPylinkissue28632 messages
2016-11-07 16:49:02PetrPycreate