Description

The encodeList function in user.py (line 157 in particular) contains the following:

   1    for item in items:
   2         item = item.strip()
   3         if not item:
   4             continue
   5         line.append(item)

Obviously, the intention of lines 3 & 4 is to skip any of the items that might be None rather than appending them to to the output list.

The problem is that NoneType doesn't have a strip() function, so the code raises an exception at line 2 above.

I encountered this error when attempting to use the quicklink action with my server setup... which, it seems, is even more deeply broken than just this. More on that when I figure it out.

MoinMoin Version

1.5

OS and Version

Fedora 4

Python Version

2.4

Server Setup

Mod Python

Server Details

Apache 2

Workaround

Moving the "strip()" line above down to after the continue statement allows the if not item check to do its job, and filter out Nones, thus solving the problem.

Result as follows:

   1    for item in items:
   2         if not item:
   3             continue
   4         item = item.strip()
   5         line.append(item)

Discussion

The bug was in user.quicklinkPage, that added None to the list when interwikiname was None.

Plan


CategoryMoinMoinBugFixed

MoinMoin: MoinMoinBugs/UserEncodeList (last edited 2007-10-29 19:19:19 by localhost)