#30565: HttpResponseBase.close not called when using FileResponse / WSGI "file
wrapper" object
-------------------------------------+-------------------------------------
Reporter: Chris Jerdonek | Owner: nobody
Type: Uncategorized | Status: new
Component: HTTP handling | Version: master
Severity: Normal | Resolution:
Keywords: HttpResponse, | Triage Stage:
streaming, StreamingHttpResponse | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Johannes Hoppe):
* type: Cleanup/optimization => Uncategorized
Comment:
Hi Chirs,
thanks for reaching out. I think you need to slow down a bit, an elaborate
a bit more on the problem that you are facing.
Let me try to paraphrase what I understood so far:
You implemented some kind of custom `FileResponse` and for some reason the
file object you pass as the `streaming_content` argument is not being
closed.
Is this correct so far?
Can you please provide a bit more code, so I can see if I am able to help.
As for the feature itself. All WSGI server should call close – as defined
in PEP333 – and if they don't, that is something that needs to be fixed in
the WSGI server, not the application.
You are also correct, that should the WSGI setup provide an OS specific
`file_wrapper`, it will ignore the HttpResponse object and only call
`close` on the file. I don't see how this is a problem in most scenarios
tho.
--
Ticket URL: <https://code.djangoproject.com/ticket/30565#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/067.f57410911c4d36cb84ed9fac8104ae32%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.