Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

__ident_func__ removed from werkzeug 2.1 #14

Open
schettino72 opened this issue Dec 19, 2021 · 4 comments · May be fixed by #15
Open

__ident_func__ removed from werkzeug 2.1 #14

schettino72 opened this issue Dec 19, 2021 · 4 comments · May be fixed by #15

Comments

@schettino72
Copy link

Code relies on __ident_func__ that will be removed from werkzeug 2.1.

See pallets/werkzeug@9dee4cd

@dtheodor
Copy link
Owner

Thanks

calpaterson added a commit to calpaterson/csvbase that referenced this issue Apr 2, 2022
@schettino72 schettino72 linked a pull request Apr 12, 2022 that will close this issue
@npcole
Copy link

npcole commented Jun 29, 2022

I am getting an error:

AttributeError: 'LocalStack' object has no attribute 'ident_func'

Will this fix it?

@wsx5031060310guy
Copy link

@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

update
https://github.com/dtheodor/flask-sqlalchemy-session/blob/47f4480ec2de87678faede4b174eb9a08fc84725/flask_sqlalchemy_session/init.py#L53

 super(flask_scoped_session, self).__init__(
            session_factory,
            scopefunc=_ident_func)

reference in here:
pallets-eco/flask-sqlalchemy@3565f05?diff=split

@npcole
Copy link

npcole commented Jul 5, 2023

Can we get this fix into the latest release?

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 a pull request may close this issue.

4 participants