-
Notifications
You must be signed in to change notification settings - Fork 1k
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
module 'resource' has no attribute 'getrusage' #2023
Comments
Do you have a file in your project named resource? |
I have an app in my project named resource yes. I just realized my MacOS updated to Sequoia 15.1. I have updated my dev.py settings by disabling debug_toolbar.panels.timer.TimerPanel. The debug toolbar is running now (less 1 panel) DEBUG_TOOLBAR_PANELS = [ |
My guess is that the toolbar is importing your resource package rather than the stdlib resource. I'm pretty confident, but only you can determine that for sure. |
You are correct. The behaviour of accessing the system-level resource has been changed I guess from Sequoia 15.0 to 15.1. This is the only difference between my yesterday's working config to today's not working. (I will not reinstall my Mac from scratch to test if this is the same on a fresh install 😆) If there are more complaining about this, we may want to update the doc or have a fall back in place. Happy to help. (and I will make a personal note to not call a module or app 'resource') |
Thank you for your help! |
I think the better approach is to have a namespace for your projects packages to avoid the conflict. So you would have I'm going to close this issue though. I don't feel like it's something we should warn about in the docs because we'd have to warn about every stdlib arguably. |
That is what my project had already 'from myproject.resource import ...', not sure to understand the sequence of events then. Anyway, will test further when I have some spare time. thank you. |
Oh, weird. Then this may be a bug with sequoia. Can you run that missing function in a normal python shell? |
It is just a simple app within my wagtail project that has 2 models and a viewset to manage resources (documents) with some additional fields. I will do more search on this as I want to understand. |
I leave this track here for later. It shows the namespace is not the same. I will dig further on a fresh project and see if I can reproduce on my Mac (this is not happening on Linux) Shell Plus Django Importsfrom django.core.cache import cache
|
You could add some code the to installed toolbar on your end to inspect what |
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 5.1.2
Wagtail version: 6.3.rc2
Exception Type: AttributeError
Exception Value:
module 'resource' has no attribute 'getrusage'
Exception Location: /Users/.../Code/wagtail/project/.venv/lib/python3.13/site-packages/debug_toolbar/panels/timer.py, line 64, in process_request
Raised during: wagtail.views.serve
Maybe due to wagtail but posting here if other have the issue with python 3.13. I will update if I can narrow down the problem or if due to wagtail.
The text was updated successfully, but these errors were encountered: