#6027: FileWrapper iterator drained by GzipMiddleware before content can be
returned
------------------------------+------------------------------------
     Reporter:  volsung@…     |                    Owner:  nobody
         Type:  Bug           |                   Status:  new
    Component:  Core (Other)  |                  Version:  SVN
     Severity:  Normal        |               Resolution:
     Keywords:                |             Triage Stage:  Accepted
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+------------------------------------

Comment (by grahamd):

 As well as FileWrapper issue where first use of request.content will
 consume it and not available on second use, you also have case where
 someone is defining a custom iterable with __iter__ which does properly
 restart. In this case if the iteration is an expensive operation, ie.,
 generating data on the fly from an operation triggered on each __iter__
 call to create actual iterable, then you end up doing the expensivee
 operation more than once. Arguable that response.content could cache the
 result within the HttpResponse object when generated. The issue there is
 obviously that people wanted to use an iterable to avoid having it all in
 memory.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/6027#comment:11>
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 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