diff --git a/spectral_cube/dask_spectral_cube.py b/spectral_cube/dask_spectral_cube.py index 08125222a..7e9cc008d 100644 --- a/spectral_cube/dask_spectral_cube.py +++ b/spectral_cube/dask_spectral_cube.py @@ -80,7 +80,7 @@ def wrapper(self, *args, **kwargs): raise ImportError("saving the cube to a temporary directory " "requires the zarr and fsspec packages to " "be installed.") - filename = tempfile.mktemp() + filenum, filename = tempfile.mkstemp() with dask.config.set(**cube._scheduler_kwargs): cube._data.to_zarr(filename) cube._data = da.from_zarr(filename)