]> git.ipfire.org Git - thirdparty/starlette.git/commit
Use os.PathLike in StaticFiles for directory (#1007)
authorKevin Stone <kevinastone@users.noreply.github.com>
Wed, 5 Aug 2020 23:04:07 +0000 (18:04 -0500)
committerGitHub <noreply@github.com>
Wed, 5 Aug 2020 23:04:07 +0000 (16:04 -0700)
commit93878323e57e0bab92b4622849c67f5a7c96b24e
tree396925f45b3640bf8545b0a95f277b4e8d685874
parent518da5eabcafa1bca832e3f16f51cf20bc7cbf57
Use os.PathLike in StaticFiles for directory (#1007)

* Use os.PathLike in StaticFiles for directory

This allows using `pathlib.Path` in addition to `str` for configuring
the base directory of the static files in line with how python3.6+
handles filesystem operations.

Fixes #1004

* Fixed `mimetypes.guess_type` not supporting PathLike on py3.7 and below

* Updated staticfiles documentation with `PathLike` param
docs/staticfiles.md
starlette/responses.py
starlette/staticfiles.py
tests/test_staticfiles.py