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-SQLAlchemy weakref KeyError #127

Closed
thomaxxl opened this issue Oct 21, 2022 · 0 comments
Closed

Flask-SQLAlchemy weakref KeyError #127

thomaxxl opened this issue Oct 21, 2022 · 0 comments

Comments

@thomaxxl
Copy link
Owner

thomaxxl commented Oct 21, 2022

Upgrading to Flask-SQLAlchemy>=3.0.0 gives this stacktrace:

  File "/home/lnx/Flask-App/venv/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 2772, in all
    return self._iter().all()
  File "/home/lnx/Flask-App/venv/lib/python3.9/site-packages/sqlalchemy/orm/query.py", line 2907, in _iter
    result = self.session.execute(
  File "/home/lnx/Flask-App/venv/lib/python3.9/site-packages/sqlalchemy/orm/session.py", line 1702, in execute
    bind = self.get_bind(**bind_arguments)
  File "/home/lnx/Flask-App/venv/lib/python3.9/site-packages/flask_sqlalchemy/session.py", line 61, in get_bind
    engines = self._db.engines
  File "/home/lnx/Flask-App/venv/lib/python3.9/site-packages/flask_sqlalchemy/extension.py", line 629, in engines
    return self._app_engines[app]
  File "/usr/lib/python3.9/weakref.py", line 405, in __getitem__
    return self.data[ref(key)]
KeyError: <weakref at 0x7f1a00f1a6d0; to 'Flask' at 0x7f1a00f16130>

Environment:

  • Python version:
    3.8.10, 3.9.5
  • Flask-SQLAlchemy version:

=3.0.0

  • SQLAlchemy version:
    SQLAlchemy==1.4.42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant