On 12/03/2015 06:21 AM, Larry Kuenning wrote:
> 
> I tried this and got:
> 
> [root@xxxxxxx mailman]# bin/user_options -h
> Traceback (most recent call last):
>   File "bin/user_options", line 98, in ?
>     main()
>   File "bin/user_options", line 52, in main
>     ns, args = parseargs()
>   File "bin/user_options", line 38, in parseargs
>     formatter=optparse.IndentedHelpFormatter())
> TypeError: __init__() got an unexpected keyword argument 'epilog'
> 
> This is under Python 2.4.3.  (Should the file be called user_options or
> user_options.py?  I tried it both ways and got the same result.)


It doesn't matter what you name the file or whether it has a .py
extension. This is only significant for withlist scripts.

The problem is your Python version. optparse.OptionParser didn't have an
'epilog' attribute in Python 2.4. That requires Python 2.5.

If you just remove the lines 36 and 37:

        epilog=Utils.wrap("""This script must be put in Mailman's bin/
directory."""),

from the script, it should work with Python 2.4, although the -h/--help
output won't contain that line.

Sorry about that. This dependency doesn't appear to be documented at
<https://docs.python.org/2/library/optparse.html#creating-the-parser>.
I'll add some comment to the script.

-- 
Mark Sapiro <[email protected]>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan
------------------------------------------------------
Mailman-Users mailing list [email protected]
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org

Reply via email to