I am using Flask's
send_file method to allow a user to download a dynamically generated Excel file. It is working fine in my local development environment. When I try to run on PythonAnywhere, I get the below error:
SystemError: <built-in function uwsgi_sendfile> returned a result with an error set
It is the same as is discussed here, in length.
The same issue is discussed here, where your team indicate that
send_file is not supported.
However, in this thread, your team state that
send_file is supported.
Here, it is stated that
send_file requires a file pointer rather than a
BytesIO object. A
BytesIO object is actually supported by Flask's
send_file method (plenty of examples & documentation online, and its working for me locally), but perhaps the poster meant that it is not supported by PythonAnywhere.
Can I check what the true status for this is? I guess I can't do the recommended fix of setting
--wsgi-disable-file-wrapper as I can't modify the uWSGI config. Is there another way?