Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Improper Method Call: Replaced mktemp #895

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion spectral_cube/dask_spectral_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from __future__ import print_function, absolute_import, division

import os
import uuid
import inspect
import warnings
Expand Down Expand Up @@ -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)
Expand Down