From 0b1d15d3ca9a9fb91859e612d8199aa3ecbfbcb0 Mon Sep 17 00:00:00 2001 From: fazledyn-or Date: Mon, 13 Nov 2023 13:47:55 +0600 Subject: [PATCH] Replaced `mktemp` with `mkstemp` Signed-off-by: fazledyn-or --- gnowsys-ndf/gnowsys_ndf/ndf/middleware/ProfileMiddleware.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnowsys-ndf/gnowsys_ndf/ndf/middleware/ProfileMiddleware.py b/gnowsys-ndf/gnowsys_ndf/ndf/middleware/ProfileMiddleware.py index 8a103b20a3..cd94514880 100644 --- a/gnowsys-ndf/gnowsys_ndf/ndf/middleware/ProfileMiddleware.py +++ b/gnowsys-ndf/gnowsys_ndf/ndf/middleware/ProfileMiddleware.py @@ -33,7 +33,8 @@ class ProfileMiddleware(object): """ def process_request(self, request): if (settings.DEBUG or request.user.is_superuser) and 'prof' in request.GET: - self.tmpfile = tempfile.mktemp() + fd, self.tmpfile = tempfile.mkstemp() + os.close(fd) self.prof = hotshot.Profile(self.tmpfile) def process_view(self, request, callback, callback_args, callback_kwargs):