diff options
| author | Andrew Artajos <andrew.artajos.dev@gmail.com> | 2015-10-08 17:05:01 +1100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-10-20 13:05:33 -0400 |
| commit | 48888a1a67db0404e5a31c9ca0349984e496f26f (patch) | |
| tree | 91561d241dd92724f485e187eed4e1d00fd5676d /django | |
| parent | 9e3f6c7483d2362660e2bee554125d0215789d9d (diff) | |
Fixed #25501 -- Made the file-based cache backend use the highest pickling protocol.
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/cache/backends/filebased.py | 4 |
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: |
