#5176: Bug in django.utils.cache._generate_cache_key(request, headerlist,
key_prefix)
-----------------------------------+----------------------------------------
          Reporter:  Eratothene    |         Owner:  nobody       
            Status:  reopened      |     Milestone:               
         Component:  Cache system  |       Version:  SVN          
        Resolution:                |      Keywords:  cache session
             Stage:  Accepted      |     Has_patch:  1            
        Needs_docs:  0             |   Needs_tests:  1            
Needs_better_patch:  1             |  
-----------------------------------+----------------------------------------
Changes (by mtredinnick):

  * needs_better_patch:  0 => 1
  * needs_tests:  0 => 1
  * stage:  Ready for checkin => Accepted

Comment:

 Please don't mark your own patches as "ready for checkin", since they
 always need a second review. In this case, there a few things I'd like to
 see addressed:

  1. The extra loop to remove empty strings from `cookie_strings` is
 unnecessary. When you're looping over that list the second time, just do
 something like `if not cookie: continue` (but on two lines).
  2. This sort of change needs a test. It's failing now and should be
 working afterwards, so prove it with a test so that we don't accidentally
 reintroduce the problem at a later date.

 A test will probably also describe the problem a bit better. I'm a little
 uncomfortable with this solution because I don't really understand how it
 is triggered. So a test that shows how a cookie is used in the normal
 course of using `TestClient` will provide us a way to confirm that the fix
 is the simplest and most robust thing we can do.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/5176#comment:11>
Django <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to