Skip to content
Myr

consistent versions and deprecation messages

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parent 16f51ef · Browse files · 4 files+26 added−23 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+26 added−23 removed

  • other:+26 added−23 removed

4 files+26 added−23 removed

modified:src/flask/json/__init__.py+13 added-12 removed
101 unmodified lines
102 or defaults.103 :param kwargs: Extra arguments passed to :func:`json.dumps`.104105 .. versionchanged:: 2.0106 ``encoding`` is deprecated and will be removed in 2.1.106 ``encoding`` is deprecated and will be removed in Flask 2.1.107108 .. versionchanged:: 1.0.3109 ``app`` can be passed directly, rather than requiring an app110 context for configuration.
3 unmodified lines
114 rv = _json.dumps(obj, **kwargs)115116 if encoding is not None:117 warnings.warn(118 "'encoding' is deprecated and will be removed in 2.1.",118 "'encoding' is deprecated and will be removed in Flask 2.1.",119 DeprecationWarning,120 stacklevel=2,121 )122
16 unmodified lines
139 :param kwargs: Extra arguments passed to :func:`json.dump`.140141 .. versionchanged:: 2.0142 Writing to a binary file, and the ``encoding`` argument, is143 deprecated and will be removed in 2.1.143 deprecated and will be removed in Flask 2.1.144 """145 _dump_arg_defaults(kwargs, app=app)146 encoding = kwargs.pop("encoding", None)147 show_warning = encoding is not None
6 unmodified lines
154155 if show_warning:156 warnings.warn(157 "Writing to a binary file, and the 'encoding' argument, is"158 " deprecated and will be removed in 2.1.",158 " deprecated and will be removed in Flask 2.1.",159 DeprecationWarning,160 stacklevel=2,161 )162
11 unmodified lines
174 or defaults.175 :param kwargs: Extra arguments passed to :func:`json.loads`.176177 .. versionchanged:: 2.0178 ``encoding`` is deprecated and will be removed in 2.1. The data179 must be a string or UTF-8 bytes.178 ``encoding`` is deprecated and will be removed in Flask 2.1. The179 data must be a string or UTF-8 bytes.180181 .. versionchanged:: 1.0.3182 ``app`` can be passed directly, rather than requiring an app183 context for configuration.
2 unmodified lines
186 encoding = kwargs.pop("encoding", None)187188 if encoding is not None:189 warnings.warn(190 "'encoding' is deprecated and will be removed in 2.1. The"191 " data must be a string or UTF-8 bytes.",190 "'encoding' is deprecated and will be removed in Flask 2.1."191 " The data must be a string or UTF-8 bytes.",192 DeprecationWarning,193 stacklevel=2,194 )195
14 unmodified lines
210 or defaults.211 :param kwargs: Extra arguments passed to :func:`json.load`.212213 .. versionchanged:: 2.0214 ``encoding`` is deprecated and will be removed in 2.1. The file215 must be text mode, or binary mode with UTF-8 bytes.214 ``encoding`` is deprecated and will be removed in Flask 2.1. The215 file must be text mode, or binary mode with UTF-8 bytes.216 """217 _load_arg_defaults(kwargs, app=app)218 encoding = kwargs.pop("encoding", None)219220 if encoding is not None:221 warnings.warn(222 "'encoding' is deprecated and will be removed in 2.1. The"223 " file must be text mode, or binary mode with UTF-8 bytes.",222 "'encoding' is deprecated and will be removed in Flask 2.1."223 " The file must be text mode, or binary mode with UTF-8"224 " bytes.",225 DeprecationWarning,226 stacklevel=2,227 )228
105 unmodified lines
modified:src/flask/cli.py+3 added-2 removed
96 unmodified lines
9798 if "script_info" in sig.parameters:99 warnings.warn(100 "The 'script_info' argument is deprecated and will not be"101 " passed to the app factory function in 2.1.",101 " passed to the app factory function in Flask 2.1.",102 DeprecationWarning,103 )104 kwargs["script_info"] = script_info105
3 unmodified lines
109 and next(iter(sig.parameters.values())).default is inspect.Parameter.empty110 ):111 warnings.warn(112 "Script info is deprecated and will not be passed as the"113 " single argument to the app factory function in 2.1.",113 " single argument to the app factory function in Flask"114 " 2.1.",115 DeprecationWarning,116 )117 args.append(script_info)118
866 unmodified lines
modified:src/flask/helpers.py+9 added-8 removed
444 unmodified lines
445 **kwargs,446):447 if attachment_filename is not None:448 warnings.warn(449 "The 'attachment_filename' parameter has been renamed to 'download_name'."450 " The old name will be removed in Flask 2.1.",449 "The 'attachment_filename' parameter has been renamed to"450 " 'download_name'. The old name will be removed in Flask"451 " 2.1.",452 DeprecationWarning,453 stacklevel=3,454 )455 download_name = attachment_filename456457 if cache_timeout is not None:458 warnings.warn(458 "The 'cache_timeout' parameter has been renamed to 'max_age'. The old name"459 " will be removed in Flask 2.1.",459 "The 'cache_timeout' parameter has been renamed to"460 " 'max_age'. The old name will be removed in Flask 2.1.",461 DeprecationWarning,462 stacklevel=3,463 )464 max_age = cache_timeout465466 if add_etags is not None:467 warnings.warn(467 "The 'add_etags' parameter has been renamed to 'etag'. The old name will be"468 " removed in Flask 2.1.",468 "The 'add_etags' parameter has been renamed to 'etag'. The"469 " old name will be removed in Flask 2.1.",470 DeprecationWarning,471 stacklevel=3,472 )473 etag = add_etags
75 unmodified lines
549 ``max_age`` replaces the ``cache_timeout`` parameter.550 ``conditional`` is enabled and ``max_age`` is not set by551 default.552552 .. versionchanged:: 2.0.0553 .. versionchanged:: 2.0554 ``etag`` replaces the ``add_etags`` parameter. It can be a555 string to use instead of generating one.556557 .. versionchanged:: 2.0
71 unmodified lines
629 :return: A safe path, otherwise ``None``.630 """631 warnings.warn(632 "'flask.helpers.safe_join' is deprecated and will be removed in"632 " 2.1. Use 'werkzeug.utils.safe_join' instead.",633 " Flask 2.1. Use 'werkzeug.utils.safe_join' instead.",634 DeprecationWarning,635 stacklevel=2,636 )637 path = werkzeug.utils.safe_join(directory, *pathnames)
144 unmodified lines
modified:src/flask/scaffold.py+1 added-1 removed
54 unmodified lines
55 :param root_path: The path that static, template, and resource files56 are relative to. Typically not set, it is discovered based on57 the ``import_name``.5859 .. versionadded:: 2.0.059 .. versionadded:: 2.060 """6162 name: str63 _static_folder = None
801 unmodified lines