#25501: Filebased cache should use the highest pickling protocol
-------------------------------------+------------------------------------
     Reporter:  BertrandBordage      |                    Owner:  dudepare
         Type:  Bug                  |                   Status:  closed
    Component:  Core (Cache system)  |                  Version:  master
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+------------------------------------

Comment (by jaap3):

 I've commented on the commit, but I'll do it here as well:

 The original intent has always been to use the highest protocol. From
 help(pickle.dumps):

   Specifying a negative protocol version selects the highest protocol
 version supported.

 So this line:

 f.write(zlib.compress(pickle.dumps(value), -1))

 Was supposed to be:

 f.write(zlib.compress(pickle.dumps(value, -1)))

 Calling zlib.compress with a compression level of -1 seems to fall back to
 the default level of 6.

--
Ticket URL: <https://code.djangoproject.com/ticket/25501#comment:9>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/073.b0c968be1265c88628e47ae099ef2159%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to