21 Sep
2022
21 Sep
'22
3:35 a.m.
On 9/20/22 19:54, Dan Caballero wrote:
I'm getting an unexpected error when I try to clear all the held messages. Any ideas what could be wrong here?
> (mailmanve) mailman@11f52637274a:/var/www/mailman-www$ mailman shell -l jewishlife@caltech.edu
> Welcome to the GNU Mailman shell
> Use commit() to commit changes.
> Use abort() to discard changes since the last commit.
> Exit with ctrl+D does an implicit commit() but exit() does not.
> The variable 'm' is the jewishlife@caltech.edu mailing list
>>>> from mailman.app.moderator import handle_message
>>>> requestdb = IListRequests(m)
>>>> for req in requestdb.held_requests:
> ... if req.request_type == RequestType.held_message:
> ... handle_message(m, req.id, Action.discard)
> ...
> Traceback (most recent call last):
> File "<console>", line 3, in <module>
> File "/opt/mailmanve/lib/python3.9/site-packages/mailman/app/moderator.py", line 112, in handle_message
> key, msgdata = requestdb.get_request(id)
> TypeError: cannot unpack non-iterable NoneType object
There is a corrupt request with a request id that doesn't exist.
Try something like:
>>> from mailman.interfaces.
>>> requestdb = IListRequests(m)
>>> for req in requestdb.held_requests:
... if req.request_type == RequestType.held_message:
... if not requestdb.get_request(req.id):
... print(f'Bad request id: {req.id}, deleting')
... requestdb.delete_request(req.id)
...
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan