summaryrefslogtreecommitdiff
path: root/django/core/cache
diff options
context:
space:
mode:
Diffstat (limited to 'django/core/cache')
-rw-r--r--django/core/cache/backends/filebased.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/core/cache/backends/filebased.py b/django/core/cache/backends/filebased.py
index c35efce92c..88a8b528b5 100644
--- a/django/core/cache/backends/filebased.py
+++ b/django/core/cache/backends/filebased.py
@@ -54,8 +54,8 @@ class FileBasedCache(BaseCache):
try:
with io.open(fd, 'wb') as f:
expiry = self.get_backend_timeout(timeout)
- f.write(pickle.dumps(expiry, -1))
- f.write(zlib.compress(pickle.dumps(value), -1))
+ f.write(pickle.dumps(expiry, pickle.HIGHEST_PROTOCOL))
+ f.write(zlib.compress(pickle.dumps(value, pickle.HIGHEST_PROTOCOL), -1))
file_move_safe(tmp_path, fname, allow_overwrite=True)
renamed = True
finally: