The context manager uses NamedTemporaryFile to store the current configuration, to later restore them. Instead of passing the file object directly to the save function, it just passes the file name, i.e. the save (and the load function) will open the file again, which is in itself not a problem. However, on the Github Windows image this leads to a permission error (using the created file object is fine).
This commit solves this by adding the file argument to Config.save() that allows to pass a file object directly to the function. The same change is applied to the load function of the config object.
The context manager uses
NamedTemporaryFile
to store the current configuration, to later restore them. Instead of passing the file object directly to the save function, it just passes the file name, i.e. the save (and the load function) will open the file again, which is in itself not a problem. However, on the Github Windows image this leads to a permission error (using the created file object is fine).This commit solves this by adding the
file
argument toConfig.save()
that allows to pass a file object directly to the function. The same change is applied to the load function of the config object.