mirror of https://github.com/pallets/flask.git
Use compat fspath instead of os.fspath
When 7ba35c4
was cherry-picked it introduced the
usage of os.fspath which is not supported on
Python <3.6
This commit is contained in:
parent
c04b0de558
commit
3ace642ef3
|
@ -1,5 +1,12 @@
|
||||||
.. currentmodule:: flask
|
.. currentmodule:: flask
|
||||||
|
|
||||||
|
Version 1.1.4
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Unreleased
|
||||||
|
|
||||||
|
- Update ``static_folder`` to use ``_compat.fspath`` instead of
|
||||||
|
``os.fspath`` to continue supporting Python <3.6 :issue:`4050`
|
||||||
|
|
||||||
|
|
||||||
Version 1.1.3
|
Version 1.1.3
|
||||||
|
|
|
@ -57,4 +57,4 @@ from .signals import template_rendered
|
||||||
from .templating import render_template
|
from .templating import render_template
|
||||||
from .templating import render_template_string
|
from .templating import render_template_string
|
||||||
|
|
||||||
__version__ = "1.1.3"
|
__version__ = "1.1.4.dev0"
|
||||||
|
|
|
@ -1001,7 +1001,7 @@ class _PackageBoundObject(object):
|
||||||
@static_folder.setter
|
@static_folder.setter
|
||||||
def static_folder(self, value):
|
def static_folder(self, value):
|
||||||
if value is not None:
|
if value is not None:
|
||||||
value = os.fspath(value).rstrip(r"\/")
|
value = fspath(value).rstrip(r"\/")
|
||||||
self._static_folder = value
|
self._static_folder = value
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -1425,7 +1425,6 @@ def test_static_url_empty_path_default(app):
|
||||||
rv.close()
|
rv.close()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires Python >= 3.6")
|
|
||||||
def test_static_folder_with_pathlib_path(app):
|
def test_static_folder_with_pathlib_path(app):
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue