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

ZeroDivisionError: float division by zero #2011

Closed
mikoumed opened this issue Oct 6, 2024 · 2 comments · Fixed by #2015
Closed

ZeroDivisionError: float division by zero #2011

mikoumed opened this issue Oct 6, 2024 · 2 comments · Fixed by #2015

Comments

@mikoumed
Copy link

mikoumed commented Oct 6, 2024

I am getting this issue when trying to display sql queries
s1 = 0 if stats[3] == 0 else s * (stats[3] / self.stats[3])
looks like the self.stats[3] can be equal to 0

@tim-schilling
Copy link
Member

Can you share how this is happening and what stats is set to? This may help us write a test.

matthiask added a commit to matthiask/django-debug-toolbar that referenced this issue Oct 13, 2024
@matthiask matthiask linked a pull request Oct 13, 2024 that will close this issue
2 tasks
@matthiask
Copy link
Member

We're dividing by self.stats[3] and checking stats[3] for zero. This is definitely broken.

@mikoumed Feedback on #2015 would be appreciated.

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 a pull request may close this issue.

3 participants