authlib icon indicating copy to clipboard operation
authlib copied to clipboard

flask: _app_ctx_stack is deprecated

Open zeha opened this issue 3 years ago • 1 comments
trafficstars

Is your feature request related to a problem? Please describe.

Flask 2.2 has deprecated app_ctx_stack.

Describe the solution you'd like

flask_client integration should ideally load without deprecation warnings.

Describe alternatives you've considered

None yet.

Additional context

https://flask.palletsprojects.com/en/2.2.x/changes/?highlight=_app_ctx_stack

The app and request contexts are managed using Python context vars directly rather than Werkzeug’s LocalStack. This should result in better performance and memory use. [#4682](https://github.com/pallets/flask/pull/4682)

Extension maintainers, be aware that _app_ctx_stack.top and _request_ctx_stack.top are deprecated. Store data on g instead using a unique prefix, like g._extension_name_attr.

zeha avatar Aug 10 '22 16:08 zeha

Would be nice to have this fix back ported to 0.15 as well since we are currently on that and it will take some effort to upgrade to v1.0 (with the breaking changes there)

jeffsawatzky avatar Aug 18 '22 16:08 jeffsawatzky

fixed in https://github.com/lepture/authlib/commit/cd66b369d141ba817b8ef0b760fae99f74b8cd86

lepture avatar Sep 25 '22 07:09 lepture

@lepture Thanks for the fix! Any idea when 1.2.0 will be released with this?

jeffsawatzky avatar Nov 13 '22 16:11 jeffsawatzky