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: 420359212
Change-Id: I172811749d2e7b901399f63df4fd1523447c6682
  • Loading branch information
mihaimaruseac authored and tensorflower-gardener committed Jan 7, 2022
1 parent a54ad73 commit 578f7ee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tensorflow/python/debug/cli/curses_ui_test.py
Expand Up @@ -86,8 +86,9 @@ def __init__(self,

# Override the default path to the command history file to avoid test
# concurrency issues.
_, history_file_path = tempfile.mkstemp() # safe to ignore fd
self._command_history_store = debugger_cli_common.CommandHistory(
history_file_path=tempfile.mktemp())
history_file_path=history_file_path)

# Below, override the _screen_ prefixed member methods that interact with the
# actual terminal, so that the mock can run in a terminal-less environment.
Expand Down

0 comments on commit 578f7ee

Please sign in to comment.