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

flask.safe_join Was Removed Without A Clear Deprecation Notice #4516

Closed
hagai-helman opened this issue Apr 1, 2022 · 1 comment
Closed

Comments

@hagai-helman
Copy link

In version 2.1.1, flask.safe_join was removed. However, the documentation for version 2.0.x did not include any deprecation notice.

A deprecation warning was raised when calling safe_join in version 2.0.x, but many developers rely on the documentation for deprecation notices. Also, the warning referred explicitly only to flask.helpers.safe_join, and not to flask.safe_join, so it made sense to assume that the shorthand flask.safe_join will continue to exist (wrapping werkzeug.utils.safe_join instead of flask.helpers.safe_join).

I suppose many developers were surprised like me from the change, and hence many applications broke after a Flask upgrade (or will break soon, when they upgrade).

To mitigate this problem, I suggest flask.safe_join is reintroduced for version 2.1.x (and as soon as possible), while a clear deprecation notice is added to the documentation.

@davidism
Copy link
Member

davidism commented Apr 1, 2022

My bad for missing the API docs. However, it was mentioned in the changelog, and also raised a DeprecationWarning.

Use a tool like pip-tools to pin your dependencies and control when you get updates. Be sure to run your tests with deprecation warnings treated as errors so that you get notified of these types of changes early.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants