From c73a43dbcb5b8788b2e0af59bb6bb74c58707152 Mon Sep 17 00:00:00 2001 From: Vladyslav Vildanov <117659936+vladvildanov@users.noreply.github.com> Date: Thu, 28 Nov 2024 16:00:10 +0200 Subject: [PATCH] Fixed unsecured tempfile.mktemp() command usage (#3446) * Fixed unsecured tempfile.mktemp() command usage * Added proper tuple handling --- tests/test_json.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_json.py b/tests/test_json.py index f4cea73787..96009cd063 100644 --- a/tests/test_json.py +++ b/tests/test_json.py @@ -1521,8 +1521,8 @@ def test_set_path(client): root = tempfile.mkdtemp() sub = tempfile.mkdtemp(dir=root) - jsonfile = tempfile.mktemp(suffix=".json", dir=sub) - nojsonfile = tempfile.mktemp(dir=root) + jsonfile = tempfile.mkstemp(suffix=".json", dir=sub)[1] + nojsonfile = tempfile.mkstemp(dir=root)[1] with open(jsonfile, "w+") as fp: fp.write(json.dumps({"hello": "world"}))