Skip to content

Fix file closing at end of request - #5255

Closed
rpkilby wants to merge 2 commits into
encode:masterfrom
rpkilby:request-closables
Closed

rpkilby wants to merge 2 commits into
encode:masterfrom
rpkilby:request-closables

Conversation

@rpkilby

@rpkilby rpkilby commented Jul 7, 2017

Copy link
Copy Markdown
Contributor

Maybe fixes #5209.

The underlying Django request object automatically closes files, however file parsing is preempted by DRF's own parsing, so it's unaware of the files and so is unable to close them. IDK if there are any negative side effects here, but simply setting the references on the underlying request seems to fix this.

@lovelydinosaur lovelydinosaur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Tho I think we should probably only copy files, not data/post?

@rpkilby

rpkilby commented Jul 7, 2017

Copy link
Copy Markdown
Contributor Author

Tho I think we should probably only copy files, not data/post?

I don't have a particularly informed opinion here. On the one hand, it's not necessary to copy data/post. On the other, does it make sense to copy files, but not data/post?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

request.FILES close

3 participants