Skip to content

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.

2 participants