Opened 5 years ago

Closed 5 years ago

#31563 closed Cleanup/optimization (wontfix)

Document edge case with uwsgi, wsgi.file_wrapper and BytesIO.

Reported by: Sergei Maertens Owned by: nobody
Component: Documentation Version: 3.0
Severity: Normal Keywords: wsgi.file_wrapper, uwsgi, streaming responses
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

The 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.

Change History (1)

comment:1 by Mariusz Felisiak, 5 years ago

Resolution: wontfix
Status: newclosed
Summary: Document edge case with uwsgi, wsgi.file_wrapper and BytesIODocument edge case with uwsgi, wsgi.file_wrapper and BytesIO.

It's too niche IMO. We cannot document all caveats.

Note: See TracTickets for help on using tickets.
Back to Top