Changes between Initial Version and Version 1 of Ticket #33755


Ignore:
Timestamp:
May 31, 2022, 2:04:47 AM (2 years ago)
Author:
Carlton Gibson
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #33755 – Description

    initial v1  
    11In `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:
    22
    3 ```
     3
     4
     5
     6{{{
    47body_file = ...
    58
     
    811finally:
    912    body_file.close()
    10 ```
     13}}}
    1114
    1215The `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.
Back to Top