Skip to content

Commit 3ace642

Browse files
brettlangdondavidism
authored andcommitted
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
1 parent c04b0de commit 3ace642

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

CHANGES.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
.. currentmodule:: flask
22

3+
Version 1.1.4
4+
-------------
5+
6+
Unreleased
7+
8+
- Update ``static_folder`` to use ``_compat.fspath`` instead of
9+
``os.fspath`` to continue supporting Python <3.6 :issue:`4050`
310

411

512
Version 1.1.3

src/flask/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@
5757
from .templating import render_template
5858
from .templating import render_template_string
5959

60-
__version__ = "1.1.3"
60+
__version__ = "1.1.4.dev0"

src/flask/helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ def static_folder(self):
10011001
@static_folder.setter
10021002
def static_folder(self, value):
10031003
if value is not None:
1004-
value = os.fspath(value).rstrip(r"\/")
1004+
value = fspath(value).rstrip(r"\/")
10051005
self._static_folder = value
10061006

10071007
@property

tests/test_basic.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,6 @@ def test_static_url_empty_path_default(app):
14251425
rv.close()
14261426

14271427

1428-
@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires Python >= 3.6")
14291428
def test_static_folder_with_pathlib_path(app):
14301429
from pathlib import Path
14311430

0 commit comments

Comments
 (0)