[Mailman-Developers] A logging bug (and a patch)
Janne Sinkkonen
janne@avocado.pc.helsinki.fi
Mon, 13 Jul 1998 12:35:35 +0300
I got these when a listadmin tried to approve/discard messages:
Jul 13 12:13:23 1998 admindb: Traceback (innermost last):
admindb: File "/home/mailman/scripts/admindb", line 232, in ?
admindb: HandleRequests(doc)
admindb: File "/home/mailman/scripts/admindb", line 125, in HandleRequests
admindb: list.HandleRequest(request, v, form[comment_key].value)
admindb: File "/home/mailman/Mailman/mm_admin.py", line 137, in HandleRequest
admindb: self.HandlePostRequest(request_data[2:], value, comment)
admindb: File "/home/mailman/Mailman/mm_admin.py", line 174, in HandlePostRequ
est
admindb: self.LogMsg("vette", note)
admindb: File "/home/mailman/Mailman/maillist.py", line 570, in LogMsg
admindb: logf.write("%s\n" % (msg % args))
admindb: TypeError : not enough arguments for format string
The reasons was that one of the messages had '18% grey card' on the subject
line. :)
Here's patch:
--- mm_admin.py~ Thu Jun 4 23:12:28 1998
+++ mm_admin.py Mon Jul 13 12:31:06 1998
@@ -171,6 +171,7 @@
note = note + "\n\tHeld: %s" % data[1]
if comment:
note = note + "\n\tDiscarded: %s" % comment
+ note = string.replace(note,'%','%%')
self.LogMsg("vette", note)
def HandleAddMemberRequest(self, data, value, comment):
... although I'm not sure whether this is a generic enough way to
handle the problem.
--
Janne