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

Empty namedqueries gives divide by zero exception #1573

Open
aplund opened this issue Apr 23, 2021 · 1 comment
Open

Empty namedqueries gives divide by zero exception #1573

aplund opened this issue Apr 23, 2021 · 1 comment
Labels

Comments

@aplund
Copy link

aplund commented Apr 23, 2021

Before you submit a bug report, please make sure that the issue still exists on the master branch!

Describe the bug

Calling namedqueries with zero defined queries gives divide by zero error

Software Versions

  • Python version: 3.9.3
  • Notmuch version: 0.31.4
  • Alot version: git 1ade6de

To Reproduce
Steps to reproduce the behaviour:

  1. have no named queries defined in notmuch
  2. call namedqueries in alot

Error Log

ERROR:ui:Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/alot/ui.py", line 723, in apply_command
    cmd.apply(self)
  File "/usr/lib/python3.9/site-packages/alot/commands/globals.py", line 591, in apply
    ui.buffer_open(buffers.NamedQueriesBuffer(ui, self.filtfun))
  File "/usr/lib/python3.9/site-packages/alot/buffers/namedqueries.py", line 21, in __init__
    self.rebuild()
  File "/usr/lib/python3.9/site-packages/alot/buffers/namedqueries.py", line 55, in rebuild
    self.querylist.set_focus(focusposition % len(self.queries))
ZeroDivisionError: integer division or modulo by zero
@pazz pazz added the bug label Apr 24, 2021
@randre03
Copy link

randre03 commented May 1, 2021

I receive the exact same error.

I installed alot and notmuch via pacman on arch linux and am running the same python and notmuch versions as @aplund. I think I have defined a query in .notmuch-config. I have it as follows:

[query] all_mail=*

(I am not certain this is the correct way, so perhaps the lack of any proper named queries in the db is contributing to the error?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants