taurus-org / taurus

Moved to https://gitlab.com/taurus-org/taurus
http://taurus-scada.org
43 stars 46 forks source link

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

Open cpascual opened 4 years ago

cpascual commented 4 years ago

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)

cpascual commented 4 years ago

@taurus-org/integrators : this is ready for review

Note, the last 2 commits are cherry picks from develop added to fix the CI tests (due to unrelated issues). Only 813f255 needs to be reviewed.