Skip to content

Ensure that (internal) files are closed in {save,load}ConfigFile

Carlos Pascual requested to merge github/fork/cpascual/config_file_closing into develop

The {save,load}ConfigFile methods accept either a file name or a file object as their argument. If a name is passed, a file object is internally created and opened, but it is not closed. This may cause trouble. Make sure the file is closed if it was internally created. Note that, in order to maintain backwards compatibility, the file won't be closed if it was passed already as a file object (the responsibility for closing lies in the opener)

Edited by Carlos Pascual

Merge request reports