[Mailman-Users] command line tool to list ban_list, discard_these_nonmembers, accept_these_nonmembers, etc
Mark Sapiro
mark at msapiro.net
Mon Jul 11 15:22:47 EDT 2016
On 07/11/2016 08:35 AM, Matthew Needham wrote:
>
> Thanks! However, I'm seeing "ValueError: zero length field name in format" whether I run it for all lists or one:
>
> [root at lw4 mailman]# ./bin/withlist -a -r list_etc
> Importing list_etc...
> Running list_etc.list_etc()...
> Loading list hdf5lib_lists.hdfgroup.org (unlocked)
> Traceback (most recent call last):
> File "./bin/withlist", line 299, in <module>
> main()
> File "./bin/withlist", line 274, in main
> r = [do_list(listname, args, func) for listname in Utils.list_names()]
> File "./bin/withlist", line 202, in do_list
> return func(m, *args)
> File "/usr/local/cpanel/3rdparty/mailman/bin/list_etc.py", line 29, in list_etc
> print('List:{}'.format(mlist.real_name))
> ValueError: zero length field name in format
> Finalizing
The issue is this "'List:{}'.format(mlist.real_name)" requires Python
2.7. With Python 2.6 it needs to be 'List:{0}'.format(mlist.real_name).
For older versions, there is no format string method, so string
interpolation as in 'List:%s' % mlist.real_name needs to be used.
I have updated the scripts at
<https://www.msapiro.net/scripts/list_etc.py> and the mirror at
<https://fog.ccsf.edu/~msapiro/scripts/list_etc.py> to work with older
Python versions.
--
Mark Sapiro <mark at msapiro.net> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan
More information about the Mailman-Users
mailing list