Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

translate.storage.mo confuses major and minor revision in little-endian MO files #3072

Open
llimeht opened this issue Aug 9, 2013 · 0 comments
Labels

Comments

@llimeht
Copy link
Contributor

llimeht commented Aug 9, 2013

Version: 1.10.0

Created attachment 944

Sample MO file

As reported in Debian bug #714214 [1], Jakub Wilk discovered that translate toolkit misunderstands little-endian MO files. He writes:

I crafted a little-endian MO file with revision 0.42. translate-toolkit
refuses to open it, saying the revision is 42.0:

from translate.storage.mo import mofile
mofile(open('messages.mo'))
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/dist-packages/translate/storage/mo.py", line 147, in init
self.parsestring(inputfile)
File "/usr/lib/python2.7/dist-packages/translate/storage/base.py", line 729, in parsestring
newstore.parse(storestring)
File "/usr/lib/python2.7/dist-packages/translate/storage/mo.py", line 262, in parse
raise base.ParseError("""Unable to process version %d.%d MO files""" % (version_maj, version_min))
translate.storage.base.ParseError: 'Unable to process version 42.0 MO files'

[1] http://bugs.debian.org/714214

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant