Skip to content

Commit

Permalink
Use tempfile.mkstemp instead of tempfile.mktemp.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mihaimaruseac committed Jan 25, 2022
1 parent 74cc54e commit a0395a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tensorflow/python/debug/wrappers/local_cli_wrapper.py
Expand Up @@ -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):
Expand Down

0 comments on commit a0395a9

Please sign in to comment.