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

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
flask/helpers.py Show resolved Hide resolved
@mattrobenolt
Copy link
Contributor Author

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

@mitsuhiko
Copy link
Contributor

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

@davidism
Copy link
Member

davidism commented Jan 4, 2019

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

@mattrobenolt
Copy link
Contributor Author

@davidism updated the versionadded tag.

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

davidism commented Jan 4, 2019

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

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
Copy link
Member

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.

@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
Development

Successfully merging this pull request may close these issues.

None yet

3 participants