Skip to content
Myr

Merge pull request #4152 from Yourun-proger/fix

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

`static_folder` can be a `pathlib.Path` object

authored by David Lord · committed by GitHub · parents 187f6ce, 9a2adfb · Browse files · 4 files+8 added−5 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+8 added−5 removed

  • other:+8 added−5 removed

4 files+8 added−5 removed

modified:src/flask/app.py+1 added-1 removed
387 unmodified lines
388 def __init__(389 self,390 import_name: str,391 static_url_path: t.Optional[str] = None,392 static_folder: t.Optional[str] = "static",392 static_folder: t.Optional[t.Union[str, os.PathLike]] = "static",393 static_host: t.Optional[str] = None,394 host_matching: bool = False,395 subdomain_matching: bool = False,396 template_folder: t.Optional[str] = "templates",
1697 unmodified lines
modified:src/flask/blueprints.py+2 added-1 removed
1import os2import typing as t3from collections import defaultdict4from functools import update_wrapper5
169 unmodified lines
175 def __init__(176 self,177 name: str,178 import_name: str,178 static_folder: t.Optional[str] = None,179 static_folder: t.Optional[t.Union[str, os.PathLike]] = None,180 static_url_path: t.Optional[str] = None,181 template_folder: t.Optional[str] = None,182 url_prefix: t.Optional[str] = None,183 subdomain: t.Optional[str] = None,
426 unmodified lines
modified:src/flask/scaffold.py+3 added-3 removed
90 unmodified lines
9192 def __init__(93 self,94 import_name: str,95 static_folder: t.Optional[str] = None,95 static_folder: t.Optional[t.Union[str, os.PathLike]] = None,96 static_url_path: t.Optional[str] = None,97 template_folder: t.Optional[str] = None,98 root_path: t.Optional[str] = None,99 ):100 #: The name of the package or module that this object belongs101 #: to. Do not change this once it is set by the constructor.102 self.import_name = import_name103104 self.static_folder = static_folder104 self.static_folder = static_folder # type: ignore105 self.static_url_path = static_url_path106107 #: The path to the templates folder, relative to108 #: :attr:`root_path`, to add to the template loader. ``None`` if
147 unmodified lines
256 else:257 return None258259 @static_folder.setter260 def static_folder(self, value: t.Optional[str]) -> None:260 def static_folder(self, value: t.Optional[t.Union[str, os.PathLike]]) -> None:261 if value is not None:262 value = os.fspath(value).rstrip(r"\/")263264 self._static_folder = value
611 unmodified lines
modified:CHANGES.rst+2 added
11 unmodified lines
12 decorators to accept functions with no arguments. :issue:`4098`13- Support View and MethodView instances with async handlers. :issue:`4112`14- Enhance typing of ``app.errorhandler`` decorator. :issue:`4095`15- Fix registering a blueprint twice with differing names. :issue:`4124`16- Fix the type of ``static_folder`` to accept ``pathlib.Path``.17 :issue:`4150`181920Version 2.0.121-------------
1154 unmodified lines