If a .po file has the following bogus preamble:
msgid ""
msgstr ""
"Project-Id-Version: Mailman 2.1b6\n"
"POT-Creation-Date: Wed Dec 11 07:44:15 2002\n"
"PO-Revision-Date: 2002-08-14 01:18:58+00:00\n"
"Last-Translator: Ousmane Wilane <wilane@cyg.sn>\n"
"Pascal George <george@lyon.inserm.fr>\n"
"Language-Team: fr <traduc@traduc.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-15\n"
"Content-Transfer-Encoding: quoted-printable\n"
"Generated-By: pygettext.py 1.3\n"
(notice that Last-Translator has an unexpected second line)
then the resulting .mo file will crash Python when a
translation is looked up. I got the following exception:
Traceback (most recent call last):
File "bin/update", line 48, in ?
from Mailman import MailList
File "/usr/local/mailman/Mailman/MailList.py", line
49, in ?
from Mailman.Archiver import Archiver
File
"/usr/local/mailman/Mailman/Archiver/__init__.py", line
17, in ?
from Archiver import *
File
"/usr/local/mailman/Mailman/Archiver/Archiver.py", line
36, in ?
from Mailman.i18n import _
File "/usr/local/mailman/Mailman/i18n.py", line 52, in ?
set_language()
File "/usr/local/mailman/Mailman/i18n.py", line 35,
in set_language
language)
File "/usr/lib/python2.1/gettext.py", line 245, in
translation
t = _translations.setdefault(key,
class_(open(mofile, 'rb')))
File "/usr/lib/python2.1/gettext.py", line 106, in
__init__
self._parse(fp)
File "/usr/lib/python2.1/gettext.py", line 180, in _parse
k, v = item.split(':', 1)
ValueError: unpack list of wrong size
make: *** [update] Erreur 1
|