% character can't be used with set_statusbar_message function

If the percent (%) character is used with the set_statusbar_message function, an exception is thrown.
Does someone know how to fix this?

Example code:
tagger.window.set_statusbar_message('%this is a test')

Error message:
File “ui\mainwindow.py”, line 438, in set_statusbar_message
TypeError: not enough arguments for format string

Try escaping the % character (because the set_statusbar_message uses % formatting):

tagger.window.set_statusbar_message(’%%this is a test’)

or possibly

tagger.window.set_statusbar_message(’\%this is a test’)

3 Likes

Thank you, this works (\% not):
tagger.window.set_statusbar_message(’%%this is a test’)