﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
33755	Move ASGI body-file cleanup into ASGIRequest	Carlton Gibson	Jonas Lundberg	"In `django/core/handlers/asgi.py` `ASGIHandler.handle()` currently creates a temporary file, `body_file`, and then maintains responsibility for closing that once the response is generated in an extend `try...finally`. In outline: 




{{{
body_file = ... 

try:
    ...
finally:
    body_file.close()
}}}

The `body_file` is passed into the request, via `create_request()` and `ASGIRequest.__init()`. Conceptually the request object takes ownership of `body_file` at that point, and ideally it would be responsible for cleaning it up too, perhaps via a `__del__` implementation. "	Cleanup/optimization	closed	HTTP handling	dev	Normal	fixed	ASGI	Jonas Lundberg	Ready for checkin	1	0	0	0	0	0
