﻿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
33361	Redis cache backend doesn't allow storing bool values	Jeremy Lainé	Jeremy Lainé	"The following code raises an exception:  `redis.exceptions.DataError: Invalid input of type: 'bool'. Convert to a bytes, string, int or float first.`

{{{#!python
from django.core.cache import cache
cache.set(""foo"", True)
}}}

This contradicts the documentation which states that any data type supported by pickle can be stored to the cache.

The root cause seems to be because instances of `int` are special-cased and not send through pickle, but redis-py cannot send booleans to redis:

https://github.com/django/django/blob/2f73e5406d54cb8945e187eff302a3a3373350be/django/core/cache/backends/redis.py#L14

What was the rationale behind the `int` special-case? `django-redis` for instance consistently sends all data through pickle."	Bug	closed	Core (Cache system)	4.0	Release blocker	fixed		Nick Pope Daniyal Abbasi	Ready for checkin	1	0	0	0	0	0
