jazzband/django-redis

PickleSerializer removed from Django main

iurisilvio opened this issue · 6 comments

PickleSerializer was deprecated and removed from Django.

https://code.djangoproject.com/ticket/29708

Actions for Django main are broken. https://github.com/jazzband/django-redis/actions/runs/3956633560/jobs/6776067867#step:7:154

@iurisilvio prepared PR to skip the test that uses PickleSerializer for Django > 4.2. As the django.contrib.sessions.serializers.PickleSerializer will be removed entirely it looks like we don't have to perform any other deprecation changes and only keep compatibility with the older Django versions. Let me know what you think about it.

but what will be used as default then?

Django removed the serializer, but their redis serializer still use pickle.

django/django@c6cb5a0

We use django PickleSerializer only to test sessions.

https://docs.djangoproject.com/en/4.1/topics/http/sessions/#session-serialization

Django changed sessions to work with a json serializer and it is their default now. I'm not sure if in the past the default was pickle.

with override_settings(

Looks like our test is based on Django test for it and they changed it some time ago. django/django@4368627

I think we should just update the test.

Pickle was necessary to serialize session expiration, but now Django save it as string.

Fixed in #647