#30567: Start passing FileResponse.block_size to wsgi.file_wrapper
-------------------------------------+-------------------------------------
     Reporter:  Chris Jerdonek       |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  HTTP handling        |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
  block_size,wsgi.file_wrapper,FileResponse,wsgi|  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by Chris Jerdonek:

Old description:

> I noticed that Django's `FileResponse` class has a `block_size` attribute
> which can be customized by subclassing:
> https://github.com/django/django/blob/415e899dc46c2f8d667ff11d3e54eff759eaded4/django/http/response.py#L393
>
> but it's not passed to `wsgi.file_wrapper`. Only the `filelike` object is
> passed:
>
> {{{
> response = environ['wsgi.file_wrapper'](response.file_to_stream)
> }}}
>
> (from:
> https://github.com/django/django/blob/415e899dc46c2f8d667ff11d3e54eff759eaded4/django/core/handlers/wsgi.py#L144
> )

New description:

 I noticed that Django's `FileResponse` class has a `block_size` attribute
 which can be customized by subclassing:
 
https://github.com/django/django/blob/415e899dc46c2f8d667ff11d3e54eff759eaded4/django/http/response.py#L393

 but it's not passed to `wsgi.file_wrapper`. Only the `filelike` object is
 passed:

 {{{
 #!python
 response = environ['wsgi.file_wrapper'](response.file_to_stream)
 }}}

 (from:
 
https://github.com/django/django/blob/415e899dc46c2f8d667ff11d3e54eff759eaded4/django/core/handlers/wsgi.py#L144
 )

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30567#comment:1>
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/067.8f73d26984e855666addd8acfe2110a5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to