Skip to content

Commit d63e46e

Browse files
authored
Drop usage of pickle (#7491)
We are moving away from it because of security concerns, just use json Addresses internal gitlab issue 2
1 parent e45ede8 commit d63e46e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

python/cuda_cccl/cuda/coop/_caching.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import hashlib
66
import json
77
import os
8-
import pickle
98

109
_ENABLE_CACHE = "CCCL_ENABLE_CACHE" in os.environ
1110
if _ENABLE_CACHE:
@@ -32,15 +31,15 @@ def cacher(*args, **kwargs):
3231
if os.path.isfile(os.path.join(_CACHE_LOCATION, h)):
3332
# open it
3433
with open(os.path.join(_CACHE_LOCATION, h), "rb") as f:
35-
out = pickle.load(f)
34+
out = json.load(f)
3635
# return cache
3736
return out
3837
else:
3938
# compute output
4039
out = func(*args, **kwargs)
4140
# store to file
4241
with open(os.path.join(_CACHE_LOCATION, h), "wb") as f:
43-
pickle.dump(out, f)
42+
json.dump(out, f)
4443
return out
4544
else:
4645
return func(*args, **kwargs)

0 commit comments

Comments
 (0)