-
-
Notifications
You must be signed in to change notification settings - Fork 301
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
Error when using error reporters - AttributeError: 'generator' object has no attribute 'load' #276
Comments
Well, looks like you've done all the heavy lifting to figure out the problem, thanks! This is also the first time I've worked with |
@jordanmkoncz curious, everything working ok after the fix? |
@danielwelch I've just been waiting for a new version of @Koed00 any chance you can do this soon? |
@Koed00 any news about this fix? |
@danielwelch I've just tested your fix out now that v0.9.0 of When I have installed and set up I did some more debugging/testing, and I think I've found a way to resolve this issue. If I edit However, after this fix, there is now another error. When the line So I think there's a few issues with how this code is working right now and I'm not sure what the best solution is, hopefully you can find a good one @danielwelch. |
@jordanmkoncz I think it’s time for me to do what I of course should have done in the first place: just test and debug this with a live sentry instance myself. Thanks for all of your feedback on this stuff, I’ll get to work on it tomorrow. |
Thanks @danielwelch :) |
@jordanmkoncz Alright, looks like this was due to an error in defining the entry_points in django-q's setup.py file. As you correctly stated, my intention here was to expose the class as the entry point that would be loaded and instantiated with the configuration provided in a user's Django settings. Because I used dot notation instead of I've loaded up a sample Django project, sentry account, and errors are successfully reporting with |
Great, cheers @danielwelch, hopefully @Koed00 can merge this fix into a new |
I'm trying to set up Sentry as an error reporter for
django-q
. I have installeddjango-q-sentry
v0.1.1, and I'm usingdjango-q
v0.8.1. When I try to run my Django project (i.e.runserver
), I get the following error:My
django-q
configuration is:This error is coming from https://github.com/Koed00/django-q/blob/v0.8.1/django_q/conf.py#L212, specifically the following code:
I'm not very familiar with
pkg_resources.iter_entry_points
but from what I can see online, it seems like it's being used incorrectly here. Resources like https://docs.pylonsproject.org/projects/pylons-webframework/en/latest/advanced_pylons/entry_points_and_plugins.html and https://www.programcreek.com/python/example/2010/pkg_resources.iter_entry_points do not use the result ofpkg_resources.iter_entry_points
directly, but rather they iterate over the result, like so:I did some debugging and when using
pkg_resources.iter_entry_points
likedjango-q
currently does, the value returned is indeed agenerator
, and this causes theAttributeError: 'generator' object has no attribute 'load'
whendjango-q
tries to callload()
on this generator. When I change this block of code so that I am instead iterating over the value returned bypkg_resources.iter_entry_points
like the example above, theentry_point
is now anEntryPoint
class, which seems to be what you'd actually want to callload()
on.The text was updated successfully, but these errors were encountered: