Skip to content

Use os.PathLike in StaticFiles for directory#1007

Merged
erewok merged 3 commits intoKludex:masterfrom
kevinastone:pathlike
Aug 5, 2020
Merged

Use os.PathLike in StaticFiles for directory#1007
erewok merged 3 commits intoKludex:masterfrom
kevinastone:pathlike

Conversation

@kevinastone
Copy link
Copy Markdown
Contributor

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

@erewok
Copy link
Copy Markdown
Contributor

erewok commented Aug 5, 2020

Hi @kevinastone. This looks like a good addition. Thank you for putting it together.

As part of this PR, would you be up for updating the documentation on staticfiles to include a note or two on using Paths in addition to strings?

In addition, can you pull latest master into your branch?

Thanks again!

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 Kludex#1004
@erewok
Copy link
Copy Markdown
Contributor

erewok commented Aug 5, 2020

Thanks again!

@erewok erewok merged commit 9387832 into Kludex:master Aug 5, 2020
@kevinastone kevinastone deleted the pathlike branch August 5, 2020 23:06
em92 added a commit to em92/starlette that referenced this pull request Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

StaticFiles directory argument should take a PathLike instead of a str

2 participants