[Mailman-Users] upgrading to mm2.1.9?

Mark Sapiro msapiro at value.net
Thu Sep 14 23:48:58 CEST 2006


Dave Stern wrote:

>On Thu, 14 Sep 2006, Dave Stern wrote:
>
>The last line of the tracedump was truncated in my initial message. 
>Here's the full text prior to the pythin (v2.1.2) and environment variables
>
>admin(1562): [----- Mailman Version: 2.1.9 -----] 
>admin(1562): [----- Traceback ------] 
>admin(1562): Traceback (most recent call last):
>admin(1562):   File "/fs/mailman2/scripts/driver", line 101, in run_main
>admin(1562):     main()
>admin(1562):   File "/fs/mailman2/Mailman/Cgi/listinfo.py", line 61, in main
>admin(1562):     list_listinfo(mlist, language)
>admin(1562):   File "/fs/mailman2/Mailman/Cgi/listinfo.py", line 176, in list_li
>stinfo
>admin(1562):     replacements['<mm-subscribe-box>'] = mlist.FormatBox('email', s
>ize=30)
>admin(1562):   File "/fs/mailman2/Mailman/HTMLFormatter.py", line 336, in Format
>Box
>admin(1562):     if isinstance(value, str):
>admin(1562): TypeError: isinstance() arg 2 must be a class or type



Ooops!

This statement in HTMLFormatter.py and a couple of similar 'isinstance'
calls in htmlformat.py are part of the security changes in  Mailman
2.1.9. The problem is the use of str as the type argument requires
Python 2.3.

The quick and dirty fix in all three cases is to replace str with
types.StringType or with type(''). I.e.

HTMLFormatter - line 336 change

        if isinstance(value, str):

to either

        if isinstance(value, types.StringType):

or

        if isinstance(value, type('')):





htmlformat.py - line 452 change

        if isinstance(value, str):

to

        if isinstance(value, types.StringType):

or

        if isinstance(value, type('')):


htmlformat.py - line 465 change

        if isinstance(text, str):

to

        if isinstance(text, types.StringType):

or

        if isinstance(text, type('')):

(or upgrade your Python :-) )

-- 
Mark Sapiro <msapiro at value.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