Skip to content
Myr

Merge pull request #4049 from brettlangdon/fix.os.fspath

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

Use compat fspath instead of os.fspath in static_folder

authored by David Lord · committed by GitHub · parents c04b0de, 3ace642 · Browse files · 4 files+9 added−3 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+9 added−3 removed

  • tests:+0 added−1 removed
  • other:+9 added−2 removed

4 files+9 added−3 removed

modified:src/flask/__init__.py+1 added-1 removed
55 unmodified lines
56from .signals import template_rendered57from .templating import render_template58from .templating import render_template_string5960__version__ = "1.1.3"60__version__ = "1.1.4.dev0"
modified:src/flask/helpers.py+1 added-1 removed
999 unmodified lines
10001001 @static_folder.setter1002 def static_folder(self, value):1003 if value is not None:1004 value = os.fspath(value).rstrip(r"\/")1004 value = fspath(value).rstrip(r"\/")1005 self._static_folder = value10061007 @property1008 def static_url_path(self):
147 unmodified lines
modified:tests/test_basic.py-1 removed
1423 unmodified lines
1424 assert rv.status_code == 2001425 rv.close()142614271428@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires Python >= 3.6")1428def test_static_folder_with_pathlib_path(app):1429 from pathlib import Path14301431 app = flask.Flask(__name__, static_folder=Path("static"))
556 unmodified lines
modified:CHANGES.rst+7 added
1.. currentmodule:: flask23Version 1.1.44-------------56Unreleased78- Update ``static_folder`` to use ``_compat.fspath`` instead of9 ``os.fspath`` to continue supporting Python <3.6 :issue:`4050`101112Version 1.1.313-------------1415Released 2021-05-13
1023 unmodified lines