﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
25501	Filebased cache should use the highest pickling protocol	Bertrand Bordage	Andrew Artajos	"I came across this bug when caching `psycopg2._range.NumericRange` objects in [https://github.com/BertrandBordage/django-cachalot django-cachalot] (in order to add Django 1.8 support to it). [https://travis-ci.org/BertrandBordage/django-cachalot/builds/83412824 My test suite was failing] only on Python 2 and with filebased (and of course, Django 1.8, because `django.contrib.postgres` didn’t exist before). This error was thrown:
{{{
TypeError: a class that defines __slots__ without defining __getstate__ cannot be pickled
}}}

This is because, unlike [https://github.com/django/django/blob/0ed7d155635da9f79d4dd67e4889087d3673c6da/django/core/cache/backends/locmem.py#L75 locmem] or [https://github.com/django/django/blob/e2a652fac1ce9af51e2dfdfb4e26a1c94cf3189c/django/core/cache/backends/db.py#L114 db], [https://github.com/django/django/blob/0ed7d155635da9f79d4dd67e4889087d3673c6da/django/core/cache/backends/filebased.py#L58 filebased uses the default pickling protocol] and not the highest available. Since we are not trying to achieve read compatibility with old Python versions, we can use the highest protocol here as well.

This issue occur on master, Django 1.7.10, 1.8.4, & 1.9 alpha 1."	Bug	closed	Core (Cache system)	dev	Normal	fixed			Accepted	1	0	0	0	1	0
