You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception is thrown. UnicodeDecodeError is not handled with a proper fallback.
Traceback (most recent call last):
File "/home/remyroy/VirtualEnvs/TestingFlask/local/lib/python2.7/site-packages/flask/app.py", line 2292, in wsgi_app
response =self.full_dispatch_request()
File "/home/remyroy/VirtualEnvs/TestingFlask/local/lib/python2.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv =self.handle_user_exception(e)
File "/home/remyroy/VirtualEnvs/TestingFlask/local/lib/python2.7/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/remyroy/VirtualEnvs/TestingFlask/local/lib/python2.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv =self.dispatch_request()
File "/home/remyroy/VirtualEnvs/TestingFlask/local/lib/python2.7/site-packages/flask/app.py", line 1799, in dispatch_requestreturnself.view_functions[rule.endpoint](**req.view_args)
File "/home/remyroy/Projects/TestingFlask/hello.py", line 10, in helloreturn send_file('hello.py', as_attachment=True, attachment_filename=fn)
File "/home/remyroy/VirtualEnvs/TestingFlask/local/lib/python2.7/site-packages/flask/helpers.py", line 567, in send_file
attachment_filename = attachment_filename.encode('latin-1')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 0: ordinal not in range(128)
Environment
Python version: 2.7.12
Flask version: 1.0.2
Werkzeug version: 0.14.1
The text was updated successfully, but these errors were encountered:
garenchan
added a commit
to garenchan/flask
that referenced
this issue
Oct 4, 2018
If attachment filename is bytes type and contains non-ascii coded bytes,
then the following ASCII encoding process will trigger
UnicodeDecodeError exception.
Fix issue pallets#2933.
If attachment filename is bytes type and contains non-ascii coded bytes,
then the following ASCII encoding process will trigger
UnicodeDecodeError exception.
Fix issue pallets#2933.
Expected Behavior
Using flask.send_file should just work no matter what the attachment_filename string parameter contains including unicode characters.
Actual Behavior
Exception is thrown. UnicodeDecodeError is not handled with a proper fallback.
Environment
The text was updated successfully, but these errors were encountered: