summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaap Roes <jroes@leukeleu.nl>2015-11-14 15:07:11 -0500
committerTim Graham <timograham@gmail.com>2015-11-14 15:10:14 -0500
commit1aba0e4c68111c99e15d9a4f4d7b4a0ec3c5da01 (patch)
tree62bb6e6ff264fdfe295fdf466fefe2c6cb44f1b1
parent25b912abbe31fa440e702b5273c18cf74e2d6e0b (diff)
Refs #25501 -- Fixed a typo in django/core/cache/backends/filebased.py
The original intent in refs #20536 was to use the highest protocol. Calling zlib.compress() with a compression level of -1 seems to fall back to the default level of 6.
-rw-r--r--django/core/cache/backends/filebased.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/core/cache/backends/filebased.py b/django/core/cache/backends/filebased.py
index 88a8b528b5..2a8b24ddfc 100644
--- a/django/core/cache/backends/filebased.py
+++ b/django/core/cache/backends/filebased.py
@@ -55,7 +55,7 @@ class FileBasedCache(BaseCache):
with io.open(fd, 'wb') as f:
expiry = self.get_backend_timeout(timeout)
f.write(pickle.dumps(expiry, pickle.HIGHEST_PROTOCOL))
- f.write(zlib.compress(pickle.dumps(value, pickle.HIGHEST_PROTOCOL), -1))
+ f.write(zlib.compress(pickle.dumps(value, pickle.HIGHEST_PROTOCOL)))
file_move_safe(tmp_path, fname, allow_overwrite=True)
renamed = True
finally: