From a0395a93a48aa1ba540fdeaad1838b2f1112f6e0 Mon Sep 17 00:00:00 2001 From: Mihai Maruseac Date: Fri, 7 Jan 2022 15:39:13 -0800 Subject: [PATCH] Use `tempfile.mkstemp` instead of `tempfile.mktemp`. The `tempfile.mktemp` function is [deprecated](https://docs.python.org/3/library/tempfile.html#tempfile.mktemp) due to [security issues](https://cwe.mitre.org/data/definitions/377.html). The switch is easy to do. PiperOrigin-RevId: 420384092 Change-Id: I8721c09ccc4de589b5a45d38e7ebc440160c72b8 --- tensorflow/python/debug/wrappers/local_cli_wrapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/python/debug/wrappers/local_cli_wrapper.py b/tensorflow/python/debug/wrappers/local_cli_wrapper.py index dfbec5b6e06bfd..d0056ec16a6b89 100644 --- a/tensorflow/python/debug/wrappers/local_cli_wrapper.py +++ b/tensorflow/python/debug/wrappers/local_cli_wrapper.py @@ -80,7 +80,7 @@ def __init__(self, self, sess, thread_name_filter=thread_name_filter) if not dump_root: - self._dump_root = tempfile.mktemp(prefix=_DUMP_ROOT_PREFIX) + self._dump_root = tempfile.mkdtemp(prefix=_DUMP_ROOT_PREFIX) else: dump_root = os.path.expanduser(dump_root) if os.path.isfile(dump_root):