__ident_func__ removed from werkzeug 2.1
Code relies on __ident_func__ that will be removed from werkzeug 2.1.
See https://github.com/pallets/werkzeug/commit/9dee4cdeef7384a0d3873fa46a65cfb9c089718b
Thanks
I am getting an error:
AttributeError: 'LocalStack' object has no attribute 'ident_func'
Will this fix it?
@npcole I get the error like this: AttributeError: '_FakeStack' object has no attribute 'ident_func'
But I fixed it by modify the code in https://github.com/dtheodor/flask-sqlalchemy-session/blob/master/flask_sqlalchemy_session/init.py
I use these version:
python 3.10
Package Version
------------------------ -------------
Flask 2.2.2
Flask-SQLAlchemy 2.5.1
Flask-SQLAlchemy-Session 1.1
greenlet 1.1.2
pip 22.2.2
SQLAlchemy 1.4.40
Werkzeug 2.2.2
find out lib/python3.10/site-packages/flask_sqlalchemy_session/init.py add
try:
from greenlet import getcurrent as _ident_func
except ImportError:
from threading import get_ident as _ident_func
super(flask_scoped_session, self).__init__(
session_factory,
scopefunc=_ident_func)
reference in here: https://github.com/pallets-eco/flask-sqlalchemy/commit/3565f0587519168c5ea4301f6e4bfba8c2ac4dee?diff=split
Can we get this fix into the latest release?