From 29cc071eddad1230d2e7f21a3d2aeb3dc7d236f1 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Thu, 17 Oct 2019 16:51:57 -0400 Subject: [PATCH] Set cache pickle protocol to 2. HIGHEST_PROTOCOL will cause it to change when we move from python 2 to 3 and this may cause issues as older machines try to read objects pickeld with a version of the protocol they don't know. During deploys, and if we have to roll back are two examples. --- openedx/core/lib/cache_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openedx/core/lib/cache_utils.py b/openedx/core/lib/cache_utils.py index e9157586b2..2c80516b8b 100644 --- a/openedx/core/lib/cache_utils.py +++ b/openedx/core/lib/cache_utils.py @@ -151,7 +151,7 @@ class process_cached(object): # pylint: disable=invalid-name def zpickle(data): """Given any data structure, returns a zlib compressed pickled serialization.""" - return zlib.compress(pickle.dumps(data, pickle.HIGHEST_PROTOCOL)) + return zlib.compress(pickle.dumps(data, 2)) # Keep this constant as we upgrade from python 2 to 3. def zunpickle(zdata):