question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Django Signals integration breaks on partial objects for python <3.10

See original GitHub issue

How do you use Sentry?

Self-hosted/on-premise

Version

1.9.9

Steps to Reproduce

  1. Use python older than 3.10.
  2. Register a partial function as a signal handler.

Expected Result

Signal is traced correctly.

Actual Result

Exception is raised from _get_receiver_name function as partial objects don’t have __module__ before python 3.10 (and even there it’s undocumented from what I can see).

It fails in our tests where we don’t even register any signals so either Django itself or some kind of integration (Sentry?) registers such signals by default.

The whole signals integration is missing a capture_internal_exceptions context too I believe.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
antonpirkercommented, Sep 27, 2022

Thanks for the update. I could now reproduce the error and have created a fix.

0reactions
antonpirkercommented, Sep 28, 2022

Finally, all the tests pass @sl0thentr0py could you please re-review? (The name generation function is now kind of complicated, but it generates nice names for python 2 and up and also for partials and normal functions)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Signals - Django documentation
Django includes a “signal dispatcher” which helps decoupled applications get notified when actions occur elsewhere in the framework. In a nutshell, signals ......
Read more >
What's New In Python 3.8 — Python 3.11.1 documentation
The new function PyCode_NewWithPosOnlyArgs() allows to create code objects like PyCode_New() , but with an extra posonlyargcount parameter for indicating the ...
Read more >
django-axes documentation - Read the Docs
Axes monitors the views by using the Django login and logout signals and locks out user at- tempts with a custom authentication backend...
Read more >
10. Changes - django-axes documentation - Read the Docs
Fix pkg_resources missing for package version resolution on runtime due to setuptools not being a runtime dependency. [asherf]; Add Python 3.10 and Django...
Read more >
FastAPI file upload not working with sentry after 1.9.6 #1595
See https://docs.sentry.io/platforms/python/guides/asgi/ for more ... DjangoIntegration: Django not installed [sentry] DEBUG: Did not import ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found