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

Fix signals problem on sentry.io #1732

Merged
merged 2 commits into from Nov 10, 2022
Merged

Conversation

antonpirker
Copy link
Member

@antonpirker antonpirker commented Nov 10, 2022

When using the newest version of the Python SDK on the sentry backend we get the following error:

tests/getsentry/billing/test_staged.py:838: in test_apply_inplace_trigger_post_save
    subscription = self.create_subscription(
    ...
/usr/local/lib/python3.8/site-packages/sentry_sdk/integrations/django/signals_handlers.py:56: in wrapper
    signal_name = _get_receiver_name(receiver)
/usr/local/lib/python3.8/site-packages/sentry_sdk/integrations/django/signals_handlers.py:28: in _get_receiver_name
    name = "partial(<function " + receiver.func.__name__ + ">)"  # type: ignore
/usr/local/lib/python3.8/unittest/mock.py:639: in __getattr__
    raise AttributeError(name)
E   AttributeError: __name__

This change gets the __name__ attribute in a very defensive way, to not raise any errors what so ever.

@vercel
Copy link

vercel bot commented Nov 10, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
sentry-python ✅ Ready (Inspect) Visit Preview Nov 10, 2022 at 1:33PM (UTC)

@sl0thentr0py
Copy link
Member

please describe the problem that Tony reported in the PR description

@antonpirker antonpirker merged commit a5ee1bd into master Nov 10, 2022
@antonpirker antonpirker deleted the antonpirker/fix-signals branch November 10, 2022 14:26
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

Successfully merging this pull request may close these issues.

None yet

2 participants