Hi,
I was wondering, does Django call the close()
method on a given buffer, after a FileResponse
was served?
I am referring to the example from the documentation: How to create PDF files
In the end it actually is a Python question. Should you call the close()
method on a buffer, as discussed in this StackOverflow question: Do I have to do StringIO.close()?
The suggestion is: Don’t rely on any magic. Call the close()
method, if you can. Anything else may or may not cause a memory leak.