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
Provenance
- Commit
b750177- Tree
56f6aba- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
218534a
4 files changed+2 added−27 removed
modified:docs/api.rst-2 removed
216 unmodified lines217 .. autofunction:: send_file218 219 .. autofunction:: send_from_directory220 221-.. autofunction:: safe_join222-221 .. autofunction:: escape222 223 .. autoclass:: Markup224 :members: escape, unescape, striptags549 unmodified linesmodified:src/flask/__init__.py-1 removed
21 unmodified lines22 from .helpers import flash as flash23 from .helpers import get_flashed_messages as get_flashed_messages24 from .helpers import get_template_attribute as get_template_attribute25 from .helpers import make_response as make_response26-from .helpers import safe_join as safe_join26 from .helpers import send_file as send_file27 from .helpers import send_from_directory as send_from_directory28 from .helpers import stream_with_context as stream_with_context29 from .helpers import url_for as url_for16 unmodified linesmodified:src/flask/helpers.py-24 removed
9 unmodified lines10 from functools import update_wrapper11 from threading import RLock12 13 import werkzeug.utils14-from werkzeug.exceptions import NotFound14 from werkzeug.routing import BuildError15 from werkzeug.urls import url_quote16 17 from .globals import _app_ctx_stack607 unmodified lines625 )626 )627 628 630-def 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.633-634- :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)646-647- if path is None:648- raise NotFound()649-650- return path651-652-629 def 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 linesmodified:CHANGES.rst+2 added
11 unmodified lines12 - 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.18 19 20 Version 2.0.221 -------------1180 unmodified lines