Skip to content
Myr

remove deprecated safe_join

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 218534a · Browse files · 4 files+2 added−27 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+2 added−27 removed

  • other:+2 added−27 removed

4 files+2 added−27 removed

modified:docs/api.rst-2 removed
216 unmodified lines
217.. autofunction:: send_file218219.. autofunction:: send_from_directory220221.. autofunction:: safe_join222221.. autofunction:: escape222223.. autoclass:: Markup224 :members: escape, unescape, striptags
549 unmodified lines
modified:src/flask/__init__.py-1 removed
21 unmodified lines
22from .helpers import flash as flash23from .helpers import get_flashed_messages as get_flashed_messages24from .helpers import get_template_attribute as get_template_attribute25from .helpers import make_response as make_response26from .helpers import safe_join as safe_join26from .helpers import send_file as send_file27from .helpers import send_from_directory as send_from_directory28from .helpers import stream_with_context as stream_with_context29from .helpers import url_for as url_for
16 unmodified lines
modified:src/flask/helpers.py-24 removed
9 unmodified lines
10from functools import update_wrapper11from threading import RLock1213import werkzeug.utils14from werkzeug.exceptions import NotFound14from werkzeug.routing import BuildError15from werkzeug.urls import url_quote1617from .globals import _app_ctx_stack
607 unmodified lines
625 )626 )627628630def safe_join(directory: str, *pathnames: str) -> str:631 """Safely join zero or more untrusted path components to a base632 directory to avoid escaping the base directory.633634 :param directory: The trusted base directory.635 :param pathnames: The untrusted path components relative to the636 base directory.637 :return: A safe path, otherwise ``None``.638 """639 warnings.warn(640 "'flask.helpers.safe_join' is deprecated and will be removed in"641 " Flask 2.1. Use 'werkzeug.utils.safe_join' instead.",642 DeprecationWarning,643 stacklevel=2,644 )645 path = werkzeug.utils.safe_join(directory, *pathnames)646647 if path is None:648 raise NotFound()649650 return path651652629def send_from_directory(630 directory: t.Union[os.PathLike, str],631 path: t.Union[os.PathLike, str],632 filename: t.Optional[str] = None,
180 unmodified lines
modified:CHANGES.rst+2 added
11 unmodified lines
12 - The CLI does not pass ``script_info`` to app factory functions.13 - ``config.from_json`` is replaced by14 ``config.from_file(name, load=json.load)``.15 - ``json`` functions no longer take an ``encoding`` parameter.16 - ``safe_join`` is removed, use ``werkzeug.utils.safe_join``17 instead.181920Version 2.0.221-------------
1180 unmodified lines