Changes between Initial Version and Version 1 of Ticket #31418, comment 6
- Timestamp:
- Apr 2, 2020, 11:05:31 AM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #31418, comment 6
initial v1 1 1 Python 3.8 introduced [https://www.python.org/dev/peps/pep-0574/ pickle protocol 5] and pointed `pickle.HIGHEST_PROTOCOL` at it. You most likely ran your project on Python 3.8 and stored things in a cache using the `FileBasedCache` backend and then tried running your project on Python 3.7. 2 2 3 If you're in process of migrating from 3.7 to 3.8 you'll likely want to subclass `FileBasedCache` and set its `pickle_protocol` to `4` and use it as your backend during the transition period. When you've fully migrated to Python 3.8 you can swap back to `FileBasedCache`.3 If you're in the process of migrating from 3.7 to 3.8 you'll likely want to subclass `FileBasedCache` and set its `pickle_protocol` to `4` and use it as your backend during the transition period. When you've fully migrated to Python 3.8 you can swap back to `FileBasedCache`. 4 4 5 I had to do similar manipulations when moving projects from Python 2 to 3 which makes me wonder if we should add a `CACHE_PICKLE_PROTOCOL` setting or allow to specify it via `CACHES['OPTIONS']` to avoid having to subclass ingbackends when such a transition is required. This is likely to be more of an issue as more and more people migrate to 3.8.5 I had to do similar manipulations when moving projects from Python 2 to 3 which makes me wonder if we should add a `CACHE_PICKLE_PROTOCOL` setting or allow to specify it via `CACHES['OPTIONS']` to avoid having to subclass backends when such a transition is required. This is likely to be more of an issue as more and more people migrate to 3.8.