#31592: Reverting Django 3.1. to Django 3.0.6 raises "binascii.Error: Incorrect
padding".
------------------------------+--------------------------------------
     Reporter:  אורי          |                    Owner:  nobody
         Type:  Bug           |                   Status:  closed
    Component:  Core (Other)  |                  Version:  3.1
     Severity:  Normal        |               Resolution:  invalid
     Keywords:                |             Triage Stage:  Unreviewed
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+--------------------------------------
Changes (by felixxm):

 * status:  new => closed
 * resolution:   => invalid
 * component:  Uncategorized => Core (Other)


Comment:

 Thanks for this ticket. This error is not related with migrations but with
 sessions and changes of a hashing algorithm from the SHA-1 to SHA-256:
 {{{
   File "django/contrib/sessions/backends/base.py", line 110, in decode
     encoded_data = base64.b64decode(session_data.encode('ascii'))
   File "python3.6/base64.py", line 87, in b64decode
     return binascii.a2b_base64(s)
 binascii.Error: Incorrect padding
 }}}

 To fix this you need to remove sessions from cache, e.g.
 {{{
 from django.contrib.sessions.models import Session
 Session.objects.all().delete()
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31592#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/069.156cfe996d4cae4b80fc5c99a0c63fa6%40djangoproject.com.

Reply via email to