Error pulling translation with 'paver i18n_robot_pull': 'plural forms expression could be dangerous'


Currently, it seems the "paver i18n_robot_pull" command is not working properly, and causing an error when updating the language in JS assets. We have been able to reproduce this issue with Hawthorn.1 and Hawthorn.2 releases for Open edX.

Note that this was originally reported on a Bitnami installation, but we were able to reproduce it edX's native stack indicating it is common to both.
We also searched for similar issues but we did not find any, please merge or close if you are already aware of this.

Find the full error trace below:

INFO:i18n.generate:Copying mapped locale /edx/app/edxapp/edx-platform/conf/locale/zh_CN/LC_MESSAGES to /edx/app/edxapp/edx-platform/conf/locale/zh_HANS/LC_MESSAGES
python lms --settings=aws compilejsi18n
Traceback (most recent call last):
File "", line 118, in <module>
File "/edx/app/edxapp/edx-platform/lms/", line 19, in run
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/", line 27, in setup
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/apps/", line 108, in populate
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/apps/", line 202, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python2.7/importlib/", line 37, in import_module
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/contrib/auth/", line 103, in <module>
class Group(models.Model):
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/", line 162, in _new_
new_class.add_to_class(obj_name, obj)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/", line 325, in add_to_class
value.contribute_to_class(cls, name)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/fields/", line 1648, in contribute_to_class
self.remote_field.through = create_many_to_many_intermediary_model(self, cls)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/db/models/fields/", line 1104, in create_many_to_many_intermediary_model
'verbose_name': ('%(from)s-%(to)s relationship') % {'from': from, 'to': to},
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/", line 162, in _mod_
return six.text_type(self) % rhs
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/", line 119, in __text_cast
return func(*self._args, **self._kw)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/translation/", line 89, in ugettext
return _trans.ugettext(message)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/translation/", line 345, in ugettext
return do_translate(message, 'ugettext')
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/translation/", line 321, in do_translate
_default = _default or translation(settings.LANGUAGE_CODE)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/translation/", line 228, in translation
_translations[language] = DjangoTranslation(language)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/translation/", line 131, in _init_
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/translation/", line 183, in _add_local_translations
translation = self._new_gnu_trans(localedir)
File "/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/translation/", line 156, in _new_gnu_trans
File "/usr/lib/python2.7/", line 496, in translation
t = translations.setdefault(key, class(fp))
File "/usr/lib/python2.7/", line 182, in _init_
File "/usr/lib/python2.7/", line 318, in _parse
self.plural = c2py(plural)
File "/usr/lib/python2.7/", line 95, in c2py
raise ValueError, 'plural forms expression could be dangerous'
ValueError: plural forms expression could be dangerous

Captured Task Output:

---> pavelib.i18n.i18n_robot_pull
---> pavelib.i18n.i18n_clean
git clean -fdX conf/locale
---> pavelib.i18n.i18n_transifex_pull
---> pavelib.i18n.i18n_validate_transifex_config
i18n_tool transifex pull
---> pavelib.i18n.i18n_extract
---> pavelib.prereqs.install_prereqs
---> pavelib.i18n.i18n_validate_gettext
i18n_tool extract
---> pavelib.i18n.i18n_dummy
i18n_tool dummy
i18n_tool generate
python lms --settings=aws compilejsi18n

Also, please find attached the full output, including the error trace above, for the 'paver i18n_robot_pull' command.

Steps to Reproduce

Launch an instance with Native stack using the "open-release/hawthorn.2" release:
Then, follow the steps below to pull translations (

  • Switch to the edxapp user: sudo -H -u edxapp bash

  • Create the '~/.transifexrc' file with the credentials for your Transifex account.

  • Load edxapp environment: source /edx/app/edxapp/edxapp_env

  • Navigate to edx-platform: cd /edx/app/edxapp/edx-platform

  • Install development requirements with Pip: pip install -r requirements/edx/development.txt

  • Pull translations: paver i18n_robot_pull

  • The previous command fails with the error mentioned in the issue.


November 28, 2018, 1:23 AM

Although I've fixed it in my server installation, I can't fix it in Docker installation. Have you found a way around?

Thank you in advance.

Ned Batchelder
November 28, 2018, 2:23 AM

I've updated the pinned versions of edx-i18n-tools and edx-ora2 on the openedx-release/hawthorn.master branch. Can you please test whether it fixes the issue?

November 29, 2018, 9:22 PM

On a clean installation and on executing

I have the following error:

If I install:

And then execute again:

I've got a different error:

I haven't change transifex client at all. I mean, it's downloading reviewed strings only.

Ned Batchelder
December 20, 2018, 9:07 AM

hawthorn.master now has this fix.

Marcos Bjoerkelund
January 30, 2019, 2:18 AM

Hi, we're still seeing the issue reported in a Native stack installation:

Note that we updated i18n packages in the following way, so we got past the original error ("ValueError: plural forms expression could be dangerous"):

Should I open a new CRI issue?



Marco Morales


Marcos Bjoerkelund

Epic Link




Platform Area