Author jwilk
Recipients jwilk
Date 2013-06-14.20:34:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1371242081.43.0.507366610452.issue18216@psf.upfronthosting.co.za>
In-reply-to
Content
The MO file format specification[0] reads:
"A program seeing an unexpected major revision number should stop reading the MO file entirely"
But Python doesn't pay attention to versions at all.

As a test-case I attached a MO file with a bogus major revision number. msgunfmt correcly rejects such a file:

$ msgunfmt messages.mo 
msgunfmt: file "messages.mo" is not in GNU .mo format

Yet Python opens it happily:

>>> import gettext
>>> t = gettext.GNUTranslations(open("messages.mo", "rb"))
>>> t.gettext("foo")
'bar'


[0] http://www.gnu.org/software/gettext/manual/html_node/MO-Files.html
History
Date User Action Args
2013-06-14 20:34:41jwilksetrecipients: + jwilk
2013-06-14 20:34:41jwilksetmessageid: <1371242081.43.0.507366610452.issue18216@psf.upfronthosting.co.za>
2013-06-14 20:34:41jwilklinkissue18216 messages
2013-06-14 20:34:41jwilkcreate