Skip to content

sentry_sdk.init() >= 1.5.9 breaks if theres a folder named redis #1402

Closed
@n-a-t-e

Description

@n-a-t-e

How do you use Sentry?

Sentry Saas (sentry.io)

Version

1.5.9

Steps to Reproduce

I have found that my app doesn't run because Sentry doesn't like there being a folder called redis. Same in 1.5.10 . This error doesn't happen using 1.5.8

This test works fine in an empty directory:
$ pip install sentry_sdk==1.5.9 && python -c "import sentry_sdk;sentry_sdk.init()"

Expected Result

nothing

Actual Result

Running the same command after mkdir redis, I get:

Requirement already satisfied: sentry_sdk==1.5.9 in /home/cioos/ceda/virtualenv/lib/python3.9/site-packages (1.5.9)
Requirement already satisfied: urllib3>=1.10.0 in /home/cioos/ceda/virtualenv/lib/python3.9/site-packages (from sentry_sdk==1.5.9) (1.26.8)
Requirement already satisfied: certifi in /home/cioos/ceda/virtualenv/lib/python3.9/site-packages (from sentry_sdk==1.5.9) (2021.10.8)
WARNING: You are using pip version 21.2.3; however, version 22.0.4 is available.
You should consider upgrading via the '/home/cioos/ceda/virtualenv/bin/python -m pip install --upgrade pip' command.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/cioos/ceda/virtualenv/lib/python3.9/site-packages/sentry_sdk/hub.py", line 105, in _init
    client = Client(*args, **kwargs)  # type: ignore
  File "/home/cioos/ceda/virtualenv/lib/python3.9/site-packages/sentry_sdk/client.py", line 86, in __init__
    self._init_impl()
  File "/home/cioos/ceda/virtualenv/lib/python3.9/site-packages/sentry_sdk/client.py", line 120, in _init_impl
    self.integrations = setup_integrations(
  File "/home/cioos/ceda/virtualenv/lib/python3.9/site-packages/sentry_sdk/integrations/__init__.py", line 122, in setup_integrations
    type(integration).setup_once()
  File "/home/cioos/ceda/virtualenv/lib/python3.9/site-packages/sentry_sdk/integrations/redis.py", line 48, in setup_once
    patch_redis_client(redis.StrictRedis)
AttributeError: module 'redis' has no attribute 'StrictRedis'

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions