From: Anthony Geay Date: Mon, 12 Aug 2024 15:22:36 +0000 (+0200) Subject: [EDF30758] : Fix missing destruction of execsafe py file in stateless mode context X-Git-Tag: emc2p_2.1.0-rc4~1^2~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=578ee504f3b65053c9412ab55d6b64e98cbb6624;p=modules%2Fkernel.git [EDF30758] : Fix missing destruction of execsafe py file in stateless mode context --- 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()