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

Add support for PathLike objects in static file helpers #3059

Merged
merged 1 commit into from Jan 5, 2019

Conversation

@mattrobenolt
Copy link
Contributor

@mattrobenolt mattrobenolt commented Jan 4, 2019

See: https://www.python.org/dev/peps/pep-0519/

This is mostly encountered with pathlib in python 3, but this API
suggests any PathLike object can be treated like a filepath with
__fspath__ function.

flask/helpers.py Outdated Show resolved Hide resolved
Loading
flask/helpers.py Show resolved Hide resolved
Loading
@mattrobenolt
Copy link
Contributor Author

@mattrobenolt mattrobenolt commented Jan 4, 2019

Also seems that master is broken since the tests failing are unrelated to my changes here afaict.

Loading

@mitsuhiko
Copy link
Member

@mitsuhiko mitsuhiko commented Jan 4, 2019

This seems fine. I need to check what's up with master.

Loading

@davidism
Copy link
Member

@davidism davidism commented Jan 4, 2019

I need to fix a test after an improvement to Werkzeug, don't worry about it.

Loading

@mattrobenolt
Copy link
Contributor Author

@mattrobenolt mattrobenolt commented Jan 4, 2019

@davidism updated the versionadded tag.

Loading

flask/_compat.py Outdated Show resolved Hide resolved
Loading
@davidism
Copy link
Member

@davidism davidism commented Jan 4, 2019

Thanks, I'll rebase and merge this once I get the test fixed.

Loading

See: https://www.python.org/dev/peps/pep-0519/

This is mostly encountered with pathlib in python 3, but this API
suggests any PathLike object can be treated like a filepath with
`__fspath__` function.
@davidism davidism merged commit 4d37aca into pallets:master Jan 5, 2019
2 checks passed
Loading
@davidism
Copy link
Member

@davidism davidism commented Jan 5, 2019

Thanks for working on this! If you're interested, I think the underlying path functions from Werkzeug should probably support this as well.

Loading

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants