From 91e64b9db45c05ee7044623eab035d0eccfb9a4e Mon Sep 17 00:00:00 2001 From: fazledyn-or Date: Tue, 5 Dec 2023 15:05:02 +0600 Subject: [PATCH] Replaced `mktemp` with `mkstemp` Signed-off-by: fazledyn-or --- spectral_cube/dask_spectral_cube.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spectral_cube/dask_spectral_cube.py b/spectral_cube/dask_spectral_cube.py index 08125222a..2ceeecf0d 100644 --- a/spectral_cube/dask_spectral_cube.py +++ b/spectral_cube/dask_spectral_cube.py @@ -4,6 +4,7 @@ from __future__ import print_function, absolute_import, division +import os import uuid import inspect import warnings @@ -80,7 +81,8 @@ 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() + fd, filename = tempfile.mkstemp() + os.close(fd) with dask.config.set(**cube._scheduler_kwargs): cube._data.to_zarr(filename) cube._data = da.from_zarr(filename)