Skip to content

Commit

Permalink
BUG: Replace mktemp with mkstemp when caching to disk for legacy …
Browse files Browse the repository at this point in the history
…plugins (#1055)

Signed-off-by: fazledyn-or <ataf@openrefactory.com>
  • Loading branch information
fazledyn-or committed Dec 5, 2023
1 parent 56cfd79 commit 12b1ad2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion imageio/core/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@ def get_local_filename(self):
ext = self.extension
else:
ext = os.path.splitext(self._filename)[1]
self._filename_local = tempfile.mktemp(ext, "imageio_")
fd, self._filename_local = tempfile.mkstemp(ext, "imageio_")
os.close(fd)
# Write stuff to it?
if self.mode.io_mode == IOMode.read:
with open(self._filename_local, "wb") as file:
Expand Down

0 comments on commit 12b1ad2

Please sign in to comment.