[Mailman-Users] Mailman Bug

Mark Sapiro mark at msapiro.net
Thu Feb 5 03:33:13 CET 2015


On 02/04/2015 09:10 AM, James Sceets wrote:
> Ok we are running version 2.1.5 on an old White Box server and are
> encountering this bug which is preventing us from accessing the
> membership management pages for some (but not all) of our mailing
> lists. 
> 
> "if bucket not in digits + '_' + lowercase:
>  TypeError: 'in <string>' requires character as left operand"
> 
> I added the '_' to the first line ...


There were some changes in 2.1.12 to allow members whose address begins
with a non-alphanumeric character to be visible and retrievable, but
before that, such members were just not seen, no bug occurred.

Looking at the 2.1.5 code, it seems the error will maybe occur only if
the URL accessing the page has a query fragment of the form 'letter=' or
'letter'. I.e. a URL similar to
http://example.com/mailman/admin/listname/members?letter=

The specific code in 2.1.5 is:

        qsenviron = os.environ.get('QUERY_STRING')
        if qsenviron:
            qs = cgi.parse_qs(qsenviron)
            bucket = qs.get('letter', 'a')[0].lower()
            if bucket not in digits + lowercase:
                bucket = None

The TypeError says that bucket is not a character (i.e. string of length
1). It is difficult to see how this could occur at all. If the value of
'letter' exists and does not have length at least 1, qs.get('letter',
'a')[0] will throw an IndexError, and if it's not a string it won't have
a .lower() method and that will throw an AttributeError.

So I have to conclude this code is modified in some way beyond adding
just the underscore.

In any case, the full error log message with the complete traceback and
python and environment info may help me say more.

-- 
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