Changes between Initial Version and Version 1 of Ticket #33755
- Timestamp:
- May 31, 2022, 2:04:47 AM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #33755 – Description
initial v1 1 1 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: 2 2 3 ``` 3 4 5 6 {{{ 4 7 body_file = ... 5 8 … … 8 11 finally: 9 12 body_file.close() 10 ``` 13 }}} 11 14 12 15 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.