Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use os.PathLike in StaticFiles for directory #1007

Merged
merged 3 commits into from Aug 5, 2020

Conversation

kevinastone
Copy link
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
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 encode#1004
@erewok
Copy link
Contributor

erewok commented Aug 5, 2020

Thanks again!

@erewok erewok merged commit 9387832 into encode: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