diff --git a/src/DIRAC/Interfaces/Utilities/DConfigCache.py b/src/DIRAC/Interfaces/Utilities/DConfigCache.py index 1021bcaabfa..c9e19c9913b 100644 --- a/src/DIRAC/Interfaces/Utilities/DConfigCache.py +++ b/src/DIRAC/Interfaces/Utilities/DConfigCache.py @@ -2,7 +2,7 @@ import os import re import time -import pickle +import pickle # nosec: B403 import tempfile from DIRAC import gLogger @@ -69,7 +69,8 @@ def cacheConfig(self): else: try: with open(self.configCacheName, "rb") as fh: - gConfigurationData.mergedCFG = pickle.load(fh) + # Pickle files are cached locally, so should be safe + gConfigurationData.mergedCFG = pickle.load(fh) # nosec: B301 reset_all_caches() except: gLogger.error("Cache corrupt or unreadable") diff --git a/src/DIRAC/TransformationSystem/Agent/TransformationAgent.py b/src/DIRAC/TransformationSystem/Agent/TransformationAgent.py index ba55387d1c6..c1611a0eb9f 100644 --- a/src/DIRAC/TransformationSystem/Agent/TransformationAgent.py +++ b/src/DIRAC/TransformationSystem/Agent/TransformationAgent.py @@ -14,7 +14,7 @@ import time import os import datetime -import pickle +import pickle # nosec: B403 import concurrent.futures from pathlib import Path @@ -672,7 +672,8 @@ def __readCache(self, transID): self.replicaCache[transID] = {} else: with open(fileName, "rb") as cacheFile: - self.replicaCache[transID] = pickle.load(cacheFile) + # Pickle files are only written locally, so should be safe + self.replicaCache[transID] = pickle.load(cacheFile) # nosec: B301 self._logInfo( "Successfully loaded replica cache from file %s (%d files)" % (fileName, self.__filesInCache(transID)),