[Mailman-Users] Hit a but & use of VERP

Mark Sapiro msapiro at value.net
Thu Nov 9 17:14:18 CET 2006

Henrik Rasmussen wrote:
>I most likely read the error message wrong, but according to the error
>message to me it seems it is line 105 in the file i18n.py that would
>contain the unexpected format character 'p', but it doesn not contain
>anything with )p

The error traceback

admin(1354):   File "/usr/lib/mailman/Mailman/Cgi/options.py", line
813, in loginpage
admin(1354):     table.AddRow([_("""In order to change your membership
option, you must
admin(1354):   File "/usr/lib/mailman/Mailman/i18n.py", line 89, in _
admin(1354):     return tns % dict
admin(1354): ValueError: unsupported format character 'p' (0x70) at
index 105

Says that the statement 'return tns % dict' at line 89 in i18n.py
encountered the error and the error was a format character of 'p' at
character position 105 in the string tns incountered in trying to
interpolate the dictionary dict into the string tns.

The string tns comes from the previous _() call at line 813 in
options.py, but it is the translation of the supplied string into the
user's preferred language. Thus it is the translataion in the
messages/<language>/LC_MESSAGES/mailman.* file that is the problem.

>However, changing "your %(extra)smembership" to "your %(extra)s
>membership" in the file /usr/lib/mailman/Mailman/Cgi/options.py have
>solved the problem. Se I guess it must have been the p in smembership
>that it was referring to.

Actually, adding the space caused the message to be untranslatable, and
that is what 'fixed' the problem.

The actual problem (fixed in Mailman 2.1.6) is in
messages/da/LC_MESSAGES/mailman.po. In 2.1.5, you find

#: Mailman/Cgi/options.py:813
msgid ""
"In order to change your membership option, you must\n"
"    first log in by giving your %(extra)smembership password in the
"    below.  If you don't remember your membership password, you can
have it\n"
"    emailed to you by clicking on the button below.  If you just want
"    unsubscribe from this list, click on the <em>Unsubscribe</em>
button and "
"    confirmation message will be sent to you.\n"
"    <p><strong><em>Important:</em></strong> From this point on, you
must "
"    cookies enabled in your browser, otherwise none of your changes
will "
"    effect.\n"
"    "
msgstr ""
"For at &aelig;ndre dine personlige indstillinger, skal du logge ind
nedenfor "
"ved at indtaste dit %(extra)password.\n"
"Hvis du ikke kan huske dit password, kan du bede om at f&aring; det
tilsendt "
"i en e-mail ved at klikke p&aring; knappen nedenfor.\n"
"Hvis du kun &oslash;nsker at framelde dig fra listen, klik da på
<em>Meld mig "
"ud</em> knappen nedenfor,\n"
"og du vil efter en kort tid modtage en e-mail som beder dig godkende
"<p><strong><em>Vigtigt:</em></strong> Din Webbrowser skal acceptere "
"modtagelse af cookies\n"
"ellers bliver ingen af &aelig;ndringerne gemt.\n"
" "

The translated line

"ved at indtaste dit %(extra)password.\n"

should be

"ved at indtaste dit %(extra)spassword.\n"

After making this change, you have to run

 bin/msgfmt.py messages/da/LC_MESSAGES/mailman.po

to rebuild the mailman.mo file.

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