Skip to content

python 3.9/flask 1.1.2 doesn't work with sentry-sdk[flask] #1348

@nirradi

Description

@nirradi

How do you use Sentry?

Sentry Saas (sentry.io)

Version

1.5.0

Steps to Reproduce

docker run -it python:3.9-buster bash

pip install flask==1.1.2 sentry-sdk[flask]==1.5.0

python -c "from sentry_sdk.integrations.flask import FlaskIntegration"

Expected Result

it works

Actual Result

error is

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/sentry_sdk/integrations/flask.py", line 29, in <module>
    from flask import (  # type: ignore
  File "/usr/local/lib/python3.9/site-packages/flask/__init__.py", line 19, in <module>
    from . import json
  File "/usr/local/lib/python3.9/site-packages/flask/json/__init__.py", line 15, in <module>
    from itsdangerous import json as _json
ImportError: cannot import name 'json' from 'itsdangerous' (/usr/local/lib/python3.9/site-packages/itsdangerous/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/sentry_sdk/integrations/flask.py", line 41, in <module>
    raise DidNotEnable("Flask is not installed")
sentry_sdk.integrations.DidNotEnable: Flask is not installed

work around, explicitly install itsdangerous==2.0.1 or up grade to flask 2.0.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions