[Mailman-Users] mailman-users at python.org line 340 is broken
Mike Sandler
msandler at HostMySite.com
Mon Jan 10 05:37:58 CET 2005
Let me start by saying that I don't know Python. Not even a little.
I got the following error:
Traceback (most recent call last):
File "/usr/local/mailman/scripts/driver", line 87, in run_main
main()
File "/usr/local/mailman/Mailman/Cgi/admin.py", line 175, in main
change_options(mlist, category, subcat, cgidata, doc)
File "/usr/local/mailman/Mailman/Cgi/admin.py", line 1296, in
change_options
gui.handleForm(mlist, category, subcat, cgidata, doc)
File "/usr/local/mailman/Mailman/Gui/Privacy.py", line 510, in
handleForm
GUIBase.handleForm(self, mlist, category, subcat, cgidata, doc)
File "/usr/local/mailman/Mailman/Gui/GUIBase.py", line 158, in
handleForm
doc.addError(
File "/usr/local/mailman/Mailman/htmlformat.py", line 340, in addError
self.AddItem(Header(3, Bold(FontAttr(
TypeError: not enough arguments for format string
and the forums seemed to be no help.
I tracked down the offending line:
self.AddItem(Header(3, Bold(FontAttr(
_(tag), color=mm_cfg.WEB_ERROR_COLOR, size='+2')).Format() +
Italic(errmsg % args).Format()))
The problem seems to be in the Italic(errmsg % args).Format() part of it
(trial and error)
I got my code to not bomb and give me a readable error with:
self.AddItem(Header(3, Bold(FontAttr( _(tag),
color=mm_cfg.WEB_ERROR_COLOR, size='+2')).Format() ))
self.AddItem(Header(3, Bold(FontAttr( errmsg,
color=mm_cfg.WEB_ERROR_COLOR, size='+2')).Format() ))
I am sure this is not ideal - I am sure that someone who knows the lang
can come up with something better - but this allowed me to find my error
(a bad email address) and fix it.
Mike
More information about the Mailman-Users
mailing list