extend deprecation for renamed send_file params

This commit is contained in:
David Lord 2021-11-12 09:21:09 -08:00
parent 48f2afbf90
commit 15a3e82823
No known key found for this signature in database
GPG key ID: 7A1C87E3F5BC42A8
2 changed files with 13 additions and 4 deletions

View file

@ -20,6 +20,15 @@ Unreleased
- The same blueprint cannot be registered with the same name. Use
``name=`` when registering to specify a unique name.
- Some parameters in ``send_file`` and ``send_from_directory`` were
renamed in 2.0. The deprecation period for the old names is extended
to 2.2. Be sure to test with deprecation warnings visible.
- ``attachment_filename`` is renamed to ``download_name``.
- ``cache_timeout`` is renamed to ``max_age``.
- ``add_etags`` is renamed to ``etag``.
- ``filename`` is renamed to ``path``.
Version 2.0.2
-------------

View file

@ -452,7 +452,7 @@ def _prepare_send_file_kwargs(
warnings.warn(
"The 'attachment_filename' parameter has been renamed to"
" 'download_name'. The old name will be removed in Flask"
" 2.1.",
" 2.2.",
DeprecationWarning,
stacklevel=3,
)
@ -461,7 +461,7 @@ def _prepare_send_file_kwargs(
if cache_timeout is not None:
warnings.warn(
"The 'cache_timeout' parameter has been renamed to"
" 'max_age'. The old name will be removed in Flask 2.1.",
" 'max_age'. The old name will be removed in Flask 2.2.",
DeprecationWarning,
stacklevel=3,
)
@ -470,7 +470,7 @@ def _prepare_send_file_kwargs(
if add_etags is not None:
warnings.warn(
"The 'add_etags' parameter has been renamed to 'etag'. The"
" old name will be removed in Flask 2.1.",
" old name will be removed in Flask 2.2.",
DeprecationWarning,
stacklevel=3,
)
@ -666,7 +666,7 @@ def send_from_directory(
if filename is not None:
warnings.warn(
"The 'filename' parameter has been renamed to 'path'. The"
" old name will be removed in Flask 2.1.",
" old name will be removed in Flask 2.2.",
DeprecationWarning,
stacklevel=2,
)