﻿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
31563	Document edge case with uwsgi, wsgi.file_wrapper and BytesIO.	Sergei Maertens	nobody	"The [https://docs.djangoproject.com/en/3.0/ref/request-response/#fileresponse-objects FileResponse] documentation mentions both the usage of `BytesIO` and possible optimizations with `wsgi.file_wrapper`.

Just today I was hit by https://github.com/unbit/uwsgi/issues/1126, which didn't manifest with `runserver`, because uwsgi optimizes this using `sendfile`. However, this is not a combination that works when you're using `BytesIO` instead of actual file handles, and uwsgi will error.

Of course, this is a very uwsgi-specific thing, and I'm not sure if it happens with gunicorn or other wsgi-servers too, but it might be good to document this where the usage of `wsgi.file_wrapper` is documented."	Cleanup/optimization	closed	Documentation	3.0	Normal	wontfix	wsgi.file_wrapper, uwsgi, streaming responses		Unreviewed	0	0	0	0	1	0
