Skip to content

Commit

Permalink
Use pickle v4 for @cached.ondisk serialization, for compatibility (#497)
Browse files Browse the repository at this point in the history
  • Loading branch information
randomir committed Oct 19, 2021
1 parent fe9225b commit 1629bd9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dwave/cloud/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,9 @@ def ondisk(cls, **kwargs):
"""@cached backed by an on-disk sqlite3-based cache."""
from dwave.cloud.config import get_cache_dir
directory = kwargs.pop('directory', get_cache_dir())
cache = diskcache.Cache(directory=directory)
# NOTE: use pickle v4 to support <py38
# TODO: consider using `diskcache.JSONDisk` if we can serialize `api.models`
cache = diskcache.Cache(directory=directory, disk_pickle_protocol=4)
return cls(cache=cache, **kwargs)


Expand Down

0 comments on commit 1629bd9

Please sign in to comment.