Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/DIRAC/Interfaces/Utilities/DConfigCache.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import re
import time
import pickle
import pickle # nosec: B403
import tempfile

from DIRAC import gLogger
Expand Down Expand Up @@ -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")
5 changes: 3 additions & 2 deletions src/DIRAC/TransformationSystem/Agent/TransformationAgent.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import time
import os
import datetime
import pickle
import pickle # nosec: B403
import concurrent.futures
from pathlib import Path

Expand Down Expand Up @@ -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)),
Expand Down
Loading