From 578ee504f3b65053c9412ab55d6b64e98cbb6624 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Mon, 12 Aug 2024 17:22:36 +0200 Subject: [PATCH] [EDF30758] : Fix missing destruction of execsafe py file in stateless mode context --- src/Container/SALOME_PyNode.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Container/SALOME_PyNode.py b/src/Container/SALOME_PyNode.py index b5a947975..9c964354d 100644 --- a/src/Container/SALOME_PyNode.py +++ b/src/Container/SALOME_PyNode.py @@ -912,7 +912,7 @@ class PythonFunctionEvaluatorParams: @property def cleanOperations(self): import os - return "To clean files : ( cd {} && rm {} )".format( os.path.dirname(self._main_filename)," ".join( [os.path.basename(self._main_filename),self._code_filename,self._in_context_filename] ) ) + return "To clean files : ( cd {} && rm {} )".format( os.path.dirname(self._main_filename)," ".join( [os.path.basename(self._main_filename),os.path.basename(self._code_filename),os.path.basename(self._in_context_filename)] ) ) def strDependingOnReturnCode(self, keepFilesToReplay, returnCode): if returnCode == -1: @@ -1000,7 +1000,8 @@ import sys sys.stderr.write({!r}) sys.stderr.flush()""".format( MY_KEY_TO_DETECT_FINISH ) ) codeFd.flush() - codeFileName = os.path.basename( codeFd.name ) + codeFileNameFull = codeFd.name + codeFileName = os.path.basename( codeFileNameFull ) contextFileName = os.path.join( dirForReplayFiles, "contextsafe_{}.pckl".format( RetrieveUniquePartFromPfx( codeFileName ) ) ) with open(contextFileName,"wb") as contextFd: pickle.dump( context, contextFd) @@ -1016,7 +1017,7 @@ sys.stderr.flush()""".format( MY_KEY_TO_DETECT_FINISH ) ) returnCode = p.returncode if returnCode == 0: break - return returnCode, stdout, stderr, PythonFunctionEvaluatorParams(mainExecFileName,codeFileName,contextFileName,resFileName) + return returnCode, stdout, stderr, PythonFunctionEvaluatorParams(mainExecFileName,codeFileNameFull,contextFileName,resFileName) ret = instanceOfLogOfCurrentSession._current_instance returnCode, stdout, stderr, evParams = InternalExecResistant( code, context, outargsname ) stdout = stdout.decode() -- 2.39.2