spcl / dace

DaCe - Data Centric Parallel Programming
http://dace.is/fast
BSD 3-Clause "New" or "Revised" License
487 stars 121 forks source link

Use file object directly in `temporary_config()` #1598

Closed philip-paul-mueller closed 2 months ago

philip-paul-mueller commented 2 months ago

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.