afewmail / afew

an initial tagging script for notmuch mail
ISC License
325 stars 98 forks source link

Verbose mode isn't verbose #181

Closed varac closed 6 years ago

varac commented 6 years ago
  -v, --verbose         be more verbose, can be given multiple times

I tried giving -v multiple times in order to get any verbosity, but it just don't change anything.

» afew -t lastmod:3480603..3480605 
» afew -vvvvvv -t lastmod:3480603..3480605
» 

were messages tagged or not ?

GuillaumeSeren commented 6 years ago

Hey @varac To me this is working fine on master see #180, so please test against master and reopen if issue is still there.

varac commented 6 years ago

Still not giving any output at all to me, running latest master.

⏻  ~  » afew -vvvvvvvv -t --new
⏻  ~  »

Can anybody else please try to reproduce ? I cannot reopen this issue.

GuillaumeSeren commented 6 years ago

Hey @varac please test the issue against the 1.3.0 ?

varac commented 6 years ago

@GuillaumeSeren: Recently I get these tracebacks:

For 1.3.0:

» afew -vvvvvvvv -t --new

Traceback (most recent call last):
  File "/home/varac/.local/bin/afew", line 11, in <module>
    load_entry_point('afew==1.3.0', 'console_scripts', 'afew')()
  File "/home/varac/.local/lib/python2.7/site-packages/afew-1.3.0-py2.7.egg/afew/commands.py", line 159, in main
    inner_main(args, database, query_string)
  File "/home/varac/.local/lib/python2.7/site-packages/afew-1.3.0-py2.7.egg/afew/main.py", line 23, in main
    filter_.run(query_string)
  File "/home/varac/.local/lib/python2.7/site-packages/afew-1.3.0-py2.7.egg/afew/filters/BaseFilter.py", line 59, in run
    for message in self.database.get_messages(query):
  File "/home/varac/.local/lib/python2.7/site-packages/afew-1.3.0-py2.7.egg/afew/Database.py", line 93, in get_messages
    for message in self.do_query(query).search_messages():
  File "/usr/lib/python2.7/dist-packages/notmuch/query.py", line 182, in search_messages
    raise NotmuchError(status)
notmuch.errors.XapianError

Same for latest master:

» afew --version
1.3.1.dev14+g6ac0d91

» afew -vvvvvvvv -t --new

Traceback (most recent call last):
  File "/home/varac/.local/bin/afew", line 11, in <module>
    load_entry_point('afew==1.3.1.dev14+g6ac0d91', 'console_scripts', 'afew')()
  File "/home/varac/.local/lib/python2.7/site-packages/afew-1.3.1.dev14+g6ac0d91-py2.7.egg/afew/commands.py", line 159, in main
    inner_main(args, database, query_string)
  File "/home/varac/.local/lib/python2.7/site-packages/afew-1.3.1.dev14+g6ac0d91-py2.7.egg/afew/main.py", line 23, in main
    filter_.run(query_string)
  File "/home/varac/.local/lib/python2.7/site-packages/afew-1.3.1.dev14+g6ac0d91-py2.7.egg/afew/filters/BaseFilter.py", line 59, in run
    for message in self.database.get_messages(query):
  File "/home/varac/.local/lib/python2.7/site-packages/afew-1.3.1.dev14+g6ac0d91-py2.7.egg/afew/Database.py", line 93, in get_messages
    for message in self.do_query(query).search_messages():
  File "/usr/lib/python2.7/dist-packages/notmuch/query.py", line 182, in search_messages
    raise NotmuchError(status)
notmuch.errors.XapianError

As verbose mode still don't work (it should be more verbose then this sole traceback right?) I don't have any idea how to fix this.

flokli commented 6 years ago

@varac I still can't reproduce logs verbose mode not being verbose, sorry. Note having 2 -v parameters is already enough for loglevel DEBUG ;-)

The posted traceback is helpful. search_messages() from notmuch.query raised a XapianError, most likely due to a wrongly formatted query string. You might want to add some more debug log statements inside afew/main.py, to get an idea where it's crashing, while checking your afew configuration for invalid queries.

varac commented 6 years ago

@floki: I'll open a seperate issue for the xapian error.

I finally got the verbose mode working, but I needed to install the afew debian package from ubuntu bionic, and remove any self built version of afew. Still a mistery why I couldn't get verbose mode working with self-built afew, but I don't have time to look deeper. Feel free to close this issue if it only affected me.

flokli commented 6 years ago

Not sure about the setup, but I'd suspect some old/broken versions lingering around somewhere and being loaded. As we can't reproduce, I'd close this one.

varac commented 6 years ago

@floki, the bug is triggered when using python2 instead of python3, see https://github.com/afewmail/afew/issues/180#issuecomment-402825613.