From 1378cd7a5f86a4250983dba89a6dbb569cf4944e Mon Sep 17 00:00:00 2001 From: garenchan <1412950785@qq.com> Date: Thu, 4 Oct 2018 21:59:58 +0800 Subject: [PATCH] Add a new test case and modify changelog. --- CHANGES.rst | 3 +++ tests/test_helpers.py | 1 + 2 files changed, 4 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index ef69bb99..30a597bf 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -14,9 +14,12 @@ Unreleased stricter about header encodings than PEP 3333. (`#2766`_) - Allow custom CLIs using ``FlaskGroup`` to set the debug flag without it always being overwritten based on environment variables. (`#2765`_) +- :func:`send_file` allows attachment filename as a ``bytes`` type that + contains unicode coded bytes. (`#2933`_) .. _#2766: https://github.com/pallets/flask/issues/2766 .. _#2765: https://github.com/pallets/flask/pull/2765 +.. _#2933: https://github.com/pallets/flask/issues/2933 Version 1.0.2 diff --git a/tests/test_helpers.py b/tests/test_helpers.py index ae1c0805..382e19a0 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -644,6 +644,7 @@ class TestSendfile(object): (u'Ñandú/pingüino.txt', '"Nandu/pinguino.txt"', '%C3%91and%C3%BA%EF%BC%8Fping%C3%BCino.txt'), (u'Vögel.txt', 'Vogel.txt', 'V%C3%B6gel.txt'), + ('tést.txt', 'test.txt', 't%C3%A9st.txt'), )) def test_attachment_filename_encoding(self, filename, ascii, utf8): rv = flask.send_file('static/index.html', as_attachment=True, attachment_filename=filename)